Thursday, July 13, 2006

Documenting CICS programs

We have more than 2,500 CICS programs in our production environment. Many of them are very old, without proper documentation, and their authors have left our company. That’s why we write REXX procedures to generate simplified schemas from PL/I, COBOL, or Assembler source. The CICSDOC REXX procedure scans specified PDS or PDSE datasets and analyses each member in the following way: • Recognizes CICS programs that are written in one of the specified languages; other members are skipped. • Identifies program name and programming language. • Searches for all EXEC CICS LINK and EXEC CICS XCTL statements and picks up the names of the called programs and calling methods. The syntax of EXEC CICS LINK or XCTL statements enables the usage of either constants or variables to specify program names. When you use constants for program names, the report looks like: Type|PgmName |Method|SubPgm| Variable |CICS DSN ------------------------------------------------------------------------ ASM |DFH$WBSA |LINK | |'DFH$WBST'|CICSTS12.CICS.SDFHSAMP(DFH$WBSA) ------------------------------------------------------------------------ ASM |DFH$WBSC |LINK | |'DFH$WBST'|CICSTS12.CICS.SDFHSAMP(DFH$WBSC) ASM |DFH$WBSC |LINK | |'DFHWBENV'|CICSTS12.CICS.SDFHSAMP(DFH$WBSC) ------------------------------------------------------------------------ COB |DFHØBAT1.|LINK | |'DFHØBAT4'|CICSTS12.CICS.SDFHSAMP(DFHØBAT1) ------------------------------------------------------------------------ Where variables are used, the procedure finds their values in declarations or in assignment statements. In that situation, the report has the following format: --------------------------------------------------------------------------------- Type| PgmName |Method|SubPgm |Variable |CICS DSN --------------------------------------------------------------------------------- COB |DFHØBAT2.| LINK | |DPL-PROG-NAME |CICSTS12.CICS.SDFHSAMP(DFHØBAT2) COB |DFHØBAT2.| |'DFHØBAT7'|DPL-PROG-NAME |CICSTS12.CICS.SDFHSAMP(DFHØBAT2) COB |DFHØBAT2.| |'DFHØBAT5'|DPL-PROG-NAME |CICSTS12.CICS.SDFHSAMP(DFHØBAT2) --------------------------------------------------------------------------------- PLI |DFHPXCC: |LINK | |TARGET_PROGRAM|CICSTS12.CICS.SDFHSAMP(DFH$PXCC) PLI |DFHPXCC: |'DFH$AXCS'|TARGET_PROGRAM|CICSTS12.CICS.SDFHSAMP(DFH$PXCC) --------------------------------------------------------------------------------- COB |DFHØVZTR.|XCTL | |WØ1-SENDNAME |CICSTS12.CICS.SDFHSAMP(DFHØVZTR) COB |DFHØVZTR.| |'DFHØVZTS'|WØ1-SENDNAME |CICSTS12.CICS.SDFHSAMP(DFHØVZTR) --------------------------------------------------------------------------------- We can imagine that a program uses one variable and assigns different program names to it. In cases where some of these programs are called by XCTL and others by LINK, the procedure cannot resolve the calling method for each program. In this situation, users have to assign an appropriate method manually. The report about all members of the input library is placed in the dataset with the symbolic name CICSDOC. In the SYSPRINT dataset, you get the list of all scanned members classified as CICS if it contains any EXEC CICS statements, or non-CICS if there are no CICS statements. EXAMPLE JOB TO SUBMIT CICSDOC The following JCL can be used to submit a job: //useridC JOB CLASS=A,MSGCLASS=X,MSGLEVEL=(Ø,Ø),NOTIFY=&SYSUID //CICSDOC EXEC PGM=IKJEFTØ1,DYNAMNBR=5Ø,REGION=4M //SYSPROC DD DSN=userid.USER.CLIST,DISP=SHR //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //CICSDOC DD DSN=userid.#CICDOC.LIST,DISP=(NEW,CATLG), // UNIT=SYSDA,DCB=(RECFM=FB,LRECL=1Ø5,BLKSIZE=Ø), // SPACE=(TRK,(1Ø,5),RLSE) //SYSTSIN DD * %CICSDOC CICSTS12.CICS.SDFHSAMP /* PROCEDURE CICSDOC /******************************* REXX *********************************/ /* Procedure forms documentation for CICS programs */ /* Input: library with CICS programs */ /* Output: Documentation in CICSDOC dataset and list of scanned */ /* members in SYSPRINT */ /* For each program report is formed with the following information: */ /* * type (PL/I, COBOL, or Assembler) */ /* * program name */ /* * calling method (xctl, link) */ /* * SubPgm */ /* * Variable */ /* * Dsname of member that contains program */ /* Trace ?R */ ARG Arg1 Arg2 userid=SYSVAR(SYSUID) prefix=SYSVAR(SYSPREF) "PROFILE NOPREFIX" rrc=Ø signal on error rrc = Make_CICS_Doc(Arg1,Arg2) error: If prefix <> '' Then "PROFILE PREFIX("prefix")" Return rrc /* Make CICS Doc */ Make_CICS_Doc: Procedure Arg DsName, Volume rrc=Ø If SYSDSN(DsName) <> 'OK' Then Do Say 'Missing dataset name' rrc=12 End To read the rest of this article, please visit Xephon's website. This complete text of this article was originally published in the July 2001 issue of CICS Update.

0 Comments:

Post a Comment

<< Home