How do I direct the output from the execution of an analysis to a dataset?

Document ID : KB000025379
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

How do I direct the output from the execution of an analysis submitted through the batch processor to a dataset?

Answer:

The Batch Processor .LIST command will route the output to a dataset as follows:

  1. Add the 'DDNAME' keyword to the .LIST - .LIST DDNAME(the ddname)

  2. Preallocate a file that the DD name above will point to as FB LRECL 80.

    1. DD in the JCL: //OUTPTDD DD DISP=SHR,DSN=TSDUMP.RBP.TESTOUT.FILE
      (Can be placed after PTIXMSG)

    2.   The .LIST command is included in the Batch Processor control cards:           .CONTROL BPID(USERID.DB2.CNTL-RECR) +   LOGID(ssid) UNIT(SYSDA)  .LIST DDNAME(OUTPTDD)  .RESTART OVERRIDE  .OPTION ERRORS RETRY(03) BINDERRORS  .CONNECT ssid
  3. Where can the .LIST command be modified?

    1. In the existing Batch Processor JCL.

    2. If new, within BP, PREVIEW the JCL that will be executed and add/modify the existing statements.

The dataset will contain the Batch Processor control statements/DDL that have executed and their return codes.
The Batch Processor Guide contains more details about the Commands available.