1.4 z/OS UNIX System Services
Many changes have occurred in the world of computing since the announcement of System/360 in 1964. Among the many significant changes is the development of the UNIX operating system by employees at AT&T's Bell Labs in the 1960s. Although UNIX has concepts such as processes and threads, which are analogous to z/OS concepts such as address spaces and tasks, many significant differences exist. For example, in UNIX, files are byte-oriented streams of data, but in z/OS, files (data sets) are record oriented.
Within z/OS, you have a complete UNIX environment with z/OS UNIX System Services. This UNIX environment is integrated with the "traditional" z/OS environment. For example, you can access a z/OS UNIX file from a batch job and you can access a data set from a z/OS UNIX application.
You can enter the world of UNIX from z/OS in several ways. From TSO, you can enter the z/OS UNIX environment using the OMVS command from the TSO READY prompt. Within the ISPF environment, you can type the command tso omvs to enter UNIX (in general, you can run any TSO command from ISPF by prefacing it with tso).
Regardless of the way you enter it, OMVS provides a shell interface where you can type UNIX commands, as shown in Figure 1.21. By default, you type commands close to the bottom, at the ===> prompt (it is possible to configure OMVS to place the ===> prompt at the top instead).
Figure 1.21 OMVS shell
Can we do our "Hello, World" example as a z/OS UNIX program? Sure! Let's do it in the C programming language. Start by using OEDIT, which is the ISPF editor for z/OS UNIX:
You are now in an editor that is very similar to the editor that you used to edit your JCL. This time, enter the "Hello, World" program, as shown in Figure 1.22. When you are done, press F3 to exit the editor. If it asks about log file disposition, as in Figure 1.15, enter 2 to delete it.
Figure 1.22 "Hello, World" program in C for OMVS
Now compile and execute the program:
c89 –o test test.c ./test
It should write the message, as shown in Figure 1.23. If the compiler fails, type exit from OMVS and LOGOFF from TSO. Then when you log back on, type 2096128 in the size field of the TSO logon panel, the panel shown in Figure 1.7 earlier. Note that the C compiler is a separate product from OMVS, and your site might not have it.
Figure 1.23 Execution of the "Hello, World" program in C for OMVS
When you are done with OMVS, use exit to leave it.