More UNIX and more JCL? I can feel my beard growing already! Let’s grow a LINUX beard together!
Manage Unix Processing with JCL
IBM Master the Mainframe 2019 Part Two – Challenge #10
Submit JCL used to execute Unix shell commands
From the ISPF primary option menu we need to issue the primary command tso submit ‘zos.public.jcl(unixsh)’. Now via SDSF we need to check the job output, we can get to that using the sd primary command and then filter using prefix ; owner Z50087; st. Change my ID to your IBM ID.
Next to the job we can use the line command ? to see the output of the job. Next to every output we can use the line command s to select and view the job output. We need to view DDNAME STDOUT with StepName SHELL. STDOUT is where the unix commands wrote the output.
Let’s go back to the output list by pressing F3. Now we need to view DDNAME SYSPRINT with StepName LISTC. This is the output of the VSAM linear data set. When you viewed it, just return using F3.
To view the JCL we can put sj line command next to the jobname in the NP column. When inside the edit mode we need to execute the primary command rep jcl(unixsh) and also copy the first 19 lines using c19 as line command at line 000001.
If you get a warning screen, then just press enter.
Modify JCL to execute Unix commands and write output to MVS Partitioned Data Set Member
This will be easy as cake! Let’s first navigate to our JCL data set using dslist jcl and edit the data set. Select s member UNIXSH.
We need to modify this member its STDOUT DD to DSN=&SYSUID..P2.OUTPUT(#10),DISP=SHR,DCB=LRECL=80. Besides that we also need to change the //STDPARM DD * to only execute 3 commands.
- sh uname -mrsvI ;
- rm -r * ;
- ls -al ;
This looks like it. I’ll submit using sub ; dslist p2.output and see if the output is there.
Looks good! TSO SCOREP2 also deems this correct. I am a happy man!