Quantcast
Channel: Astr0baby's not so random thoughts _____ rand() % 100;
Viewing all articles
Browse latest Browse all 183

z/OS UNIX first look

$
0
0

Accessing the UNIX shell from the z/OS TSO session is really simple and it was the only thing I really wanted to see.  I will only highlight some point of interest from the UNIX perspective here, like the shell environment, structure, commands and compilers. We will build a simple C program in the end.

So once we login via TSO

In the menu we will select option 6 [Command]   <ENTER>

And enter the TSO command OMVS

– Following is taken from the https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatiszunix.htm

The OMVS command is used to invoke the z/OS UNIX shell. Users whose primary interactive computing environment is a UNIX system should find the z/OS UNIX shell environment familiar.

You use the OMVS command to invoke the z/OS UNIX shell.

The shell is a command processor that you use to:

  • Invoke shell commands or utilities that request services from the system.
  • Write shell scripts using the shell programming language.
  • Run shell scripts and C-language programs interactively (in the foreground), in the background, or in batch.

Shell commands often have options (also known as flags ) that you can specify, and they usually take an argument, such as the name of a file or directory. The format for specifying the command begins with the command name, then the option or options, and finally the argument, if any.

For example, in Figure 1 the following command is shown:

ls -al /u/rogers

where ls is the command name, and -al are the options.

Figure 1. OMVS shell session display after issuing the OMVS command
ROGERS @ SC43:/>ls -al /u/rogers
total 408
drwx------  3 ADMIN   SYS1           8192 Aug  1 2005  .
dr-xr-xr-x 93 AAAAAAA TTY               0 Feb 13 11:14 ..
-rwxr-xr-x  1 ADMIN   SYS1            979 Feb 29 1996  .profile
-rw-------  1 ADMIN   SYS1             29 Mar  1 1996  .sh_history
-rw-r--r--  1 AAAAAAA SYS1          84543 Apr 28 2007  Sc.pdf
drwxr-xr-x  2 AAAAAAA SYS1           8192 Jun 25 2001  data
-rw-r--r--  1 AAAAAAA SYS1          47848 Jun 26 2004  inventory.export
-rwx------  1 AAAAAAA SYS1             16 Aug  1 2005  myfile
-rw-r--r--  1 AAAAAAA SYS1          43387 Jun 22 2007  print.export

This command lists the files and directories of the user. If the pathname is a file, ls displays information on the file according to the requested options. If it is a directory, ls displays information on the files and subdirectories therein. You can get information on a directory itself by using the -d option.

If you do not specify any options, ls displays only the file names. When ls sends output to a pipe or file, it writes one name per line; when it sends output to the terminal, it uses the -C (multi-column) format.

Terminology note: z/OS users tend to use the terms data set and file synonymously, but not when it comes to z/OS UNIX System Services. With the UNIX support in z/OS, the file system is a data set that contains directories and files. So file has a very specific definition. z/OS UNIX files are different from other z/OS data sets because they are byte-oriented rather than record-oriented.

So we will end up with the following screen

One important thing to understand here is the prompt at the bottom of the x3270 terminal

===> this is were all the commands go   (it is slightly weird to get used to )

We can run stuff like “id , whoami, env … ”

Check the process tree via ps

the filesystem is not complex and is quite simple realy, most system binaries reside in /bin, /usr/sbin and /usr/lpp   as we can see from the above screenshot

Even Java is there (in this example it is an aged version of z/OS)

sshd and all the related programs are available (again aged in this version)

And of course some C compilers

And finally a small test to compile a simplest of C programs … unfortunately I could not figure out how to define the x3270 terminal for the vi editor so I have used ed instead.

Ed is a single line editor which you can use in emergencies like this :)

 


Viewing all articles
Browse latest Browse all 183

Trending Articles