Introduction

CA Gen enables application development on Windows workstations and supports application deployment to integrate multiple platforms on z/OS (CICS and IMS), UNIX, Linux, Windows, .NET and J2EE.

CA is Computer Associates. And CA Gen is one of their product.

16) GEN, CA GEN, CoolGEN batch job related another best practice



The batch jobs of COOL:Gen even though they execute successfully, they return with a return code of 100. For unsuccessful executions, it displays the return code as given by the TP monitor.

Best Practice:
Instead of invoking the batch program as given below:
...
//SYSTSIN        DD       *
            DSN SYSTEM(DB2T)
            RUN PROGRAM(PROGA) PLAN(PROGA)
            END
/*

Execute it as follows:
..
//SYSPROC      DD       DSN=SYS2.COOLGEN.CLIST,DISP=SHR

...
//SYSTSIN        DD       *
            EXECDSN PROGA DB2T
/*

The contents of EXECDSN will look like:
/* Rexx */
Parse Upper Arg programname db2system .
"NEWSTACK"
Queue "RUN PROGRAM("programname") PLAN("programname")"
Queue "END"
"DSN SYSTEM("db2system")"
Coolgenrc = Rc
"DELSTACK"
If Coolgenrc = 100 Then
            Exit 0

Exit Coolgenrc

15) GEN, CA GEN, CoolGEN batch job related best practice


GEN, CA GEN, CoolGEN batch job related best practice

If a batch step due to its logic doesn’t write even a single record to the output file created in the same step, and a subsequent step has a read from this file. The read fails with an abend.

Best Practice:
The abend occurs because the EOF marker is not set if the file is not opened and closed for output. A dummy step is introduced in between these 2 steps, which will write the EOF marker if the file is empty. This is achieved as follows:
//STEP01          PGM=IKJEFT01
//FILE01            DD        DSN=SBBT02.NEW.FILE,DISP=(,CATLG),…
//SYSTSIN        DD        *
            EXECDSN progname db2system
/*
//STEP03          PGM=IKJEFT01
//FILE01            DD        DSN=SBBT02.NEW.FILE,DISP=SHR
//SYSTSIN        DD        *
            EXECDSN progname db2system
/*

Instead add the following step in between the two steps:
//STEP01          PGM=IKJEFT01
//FILE01            DD        DSN=SBBT02.NEW.FILE,DISP=(,CATLG),…
//SYSTSIN        DD        *
            EXECDSN progname db2system
/*
//STEP02          PGM=IKJEFT01
//SYSPROC      DD        DSN=SYS2.COOLGEN.CLIST,DISP=SHR
//FILE01           DD        DSN=SBBT02.NEW.FILE,DISP=SHR
//SYSTSIN        DD        *
            EMPTYFLE
/*
//STEP03          PGM=IKJEFT01
//FILE01            DD        DSN=SBBT02.NEW.FILE,DISP=SHR
//SYSTSIN        DD        *
            EXECDSN progname db2system
/*

The logic in the REXX program would contain logic like this:

/* Rexx */
“NEWSTACK”
“EXECIO * DISKR FILE01 (FINIS”
Queue “”
“EXECIO * DISKW FILE01 (FINIS”
“DELSTACK”

Exit