IBM MTM 2019: Part Two – Challenge #10

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 SHELLSTDOUT 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 LISTCThis 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=80Besides that we also need to change the //STDPARM DD * to only execute 3 commands.

  • sh uname -mrsvI ;
  • rm -r * ;
  • ls -al ;

Let’s see.

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!

Leave a Reply

Your email address will not be published. Name, email and website not required.