Previous Topic Next topic Print topic


Creating a CICS Application to write JCL

The CICS application should write the JCL job stream to the transient data queue (DCT) that you defined in ESMAC, using the CICS command WRITEQ TD.

You need to compile the program with a non-mainframe dialect specified, and with the CICSECM directive set.

Example

 working-storage section.
 78 78-table-size value 22.
 01 ws-table.
     02 value '//CPJTEST JOB ''CPJX'',CLASS=A,MSGCLASS=A ' pic x(80).
     02 value '//*   NOTIFY=CPJ,                         ' pic x(80).
     02 value '//*   USER=CPJ,                           ' pic x(80).
     02 value '//*   PASSWORD=WIBBLE                     ' pic x(80).
     02 value '//*                                       ' pic x(80).
     02 value '//STEP00   EXEC PGM=IEFBR14               ' pic x(80).
     02 value '//A DD DUMMY                              ' pic x(80).
     02 value '//*                                       ' pic x(80).
     02 value '//DUMMY EXEC PGM=IEFBR14                  ' pic x(80).
     02 value '//NEWDSN DD DSN=MFICPJ.WORK.DATA,         ' pic x(80).
     02 value '//       DISP=(,CATLG),                   ' pic x(80).
     02 value '//       DCB=(LRECL=80,RECFM=FB,DSORG=PS),' pic x(80).
     02 value '//       SPACE=(800,(10,10)),UNIT=SYSDA   ' pic x(80).
     02 value '//*                                       ' pic x(80).
     02 value '//GENER EXEC PGM=IEBGENER                 ' pic x(80).
     02 value '//SYSPRINT DD SYSOUT=*                    ' pic x(80).
     02 value '//SYSUT1 DD *                             ' pic x(80).
     02 value 'Rec 1                                     ' pic x(80).
     02 value 'Rec 2                                     ' pic x(80).
     02 value '//SYSUT2 DD SYSOUT=*                      ' pic x(80).
     02 value '//                                        ' pic x(80).
     02 value '/*EOF                                     ' pic x(80).
 01 redefines ws-table.
     02 ws-table-line occurs 78-table-size times           pic x(80).
 01  ws-queue   value 'IRDR'           pic x(4).
 01  ws-x                              pic x(4) comp-5.
 procedure division.
     exec cics enq
        resource(ws-queue)
     end-exec
     perform varying ws-x from 1 by 1
         until ws-x > 78-table-size
          exec cics writeq td
               queue(ws-queue)
               from (ws-table-line(ws-x))
          end-exec
     end-perform
     exec cics send from(ws-table) erase end-exec
     exec cics return end-exec
     stop run
     .
Previous Topic Next topic Print topic