Manage Unix Processing with JCL
Part Two - Challenge #10


z/OS is a powerful blend of technology

The Unix operating system started as an internal project at Bell Labs, and has gone on to be the basis of Linux, Android, MacOS, and countless other computing platforms. It is in fact so prevalent in the world of IT that many users wished they could somehow combine the two so they didn’t have to have two sets of computers to work on both platforms.

Unix System Services (USS) was developed on IBM Z so that users familiar with Unix could have access to a Unix-style interface without having to leave the mainframe. Today, USS is used not only by developers and systems programmers, but leveraged by the core z/OS operating system to provide functionality and scripting ability.

Unix is a critical component of z/OS. The Unix component enabled z/OS has taken the z/OS grandfather operating system MVS far beyond the original classic capabilities. MVS classic capabilities are still critical, trusted, and widely used. The tightly coupled Unix in the z/OS environment capabilities are not yet fully realized. The opportunities to modernize business applications and the development of business applications is just beginning. While much has been done, more will happen in the future.

The purpose of challenge 10 is a simple demonstration of mixing classic JCL with Unix shell processing.

A part of the challenge is the increasingly abbreviated instructions that demonstrated your increased skill level with z/OS.


Submit JCL used to execute Unix shell commands

You will be exposed to details about your personal Unix directory. The information you learn is necessary to complete the next step of the challenge.

  1. From ISPF command line, enter tso submit 'zos.public.jcl(unixsh)'
  2. From SDSF, view the JCL job output using ?
  3. Select s the output identified by DDNAME STDOUT and StepName SHELL
    STDOUT is where the Unix commands wrote the command output
  4. F3 or end to exit back to JCL JOB output
  5. Select s the output identified by DDNAME SYSPRINT and StepName LISTC
    SYSPRINT is output about the VSAM Linear data set formatted to filesystems including your personal filesystem
      The output does NOT play a part in challenge 10 but will play a part in a Part 3 challenge
  6. F3 or end to exit back to JCL JOB output
  7. F3 or end to exit back to SDSF Status panel
  8. Enter sj to the left of UNIXSH JCL job to see the JCL used to create the output
      What follows //STDPARM DD * is the Unix command input
      What follows //LISTC EXEC PGM=IDCAMS will be used in a Part 3 challenge
  9. While in SDSF EDIT of UNIXSH JCL -
      type ISPF primary command rep jcl(unixsh)
      tab until cursor is positioned on 000001 to enter an ISPF line command
      type ISPF line command c19 on line 0000001 to copy 19 lines, then enter
      truncation message is expected, enter to proceed

Modify JCL to execute Unix commands and write output to MVS Partitioned Data Set Member

If the previous challenge 10 action was completed successfully, then your JCL partitioned data set has member UNIXSH

  1. From ISPF command line, enter dslist jcl
  2. Edit e your JCL partitioned data set
  3. Select s member name UNIXSH

You previously executed UNIXSH JCL.

Description of the UNIXSH JCL

  • BPXBATCH is a system supplied utility program to interact with z/OS Unix services
  • BPXBATCH writes to STDOUT and STDERR
  • BPXBATCH reads from STDPARM
  • Observe all the Unix commands following //STDPARM DD * are terminated with a semi-colon (;)
  • Observe sh is the first STDPARM input providing a shell for the Unix commands that follow
  • Observe //STDOUT DD is writing output to the JES spool, SYSOUT=*

Modify and submit the JCL member UNIXSH as follows to complete the challenge:

  • Modify //STDOUT DD statement to write Unix command output to
  • Modify //STDPARM DD * input to process only 3 Unix commands
      1) sh uname -mrsvI ;
      2) rm -r * ;
      3) ls -al ;
  • Enter sub ; dslist p2.output to submit JCL and list your p2.output partitioned data set
  • Your p2.output member #10 should contain Unix command output

If successful, then p2.output(#10) will contain output from the Unix uname and ls commands

If p2.output(#10) is without output from the Unix uname and ls commands, then review JCL job output and make necessary corrections

You are ready for the next challenge!

Next: Challenge #11