Creating side files with the HFZLANGX utility

The HFZLANGX utility program converts a compiler listing or SYSADATA file to a LANGX side file.

Creating a side file by compiling a program and processing the listing

The JCL in Sample JCL to compile a COBOL program and store the side file is provided as a sample in member HFZSCMPS in the HFZ.SHFZSAM1 data set. It performs the following steps:
  1. Compiles a COBOL program.
    Note: You can compile only one program per compile step in order to name the compiler listing PDS(E) member (if using a partitioned data set), and to ensure that only one compiler listing is written to the output file. Nested COBOL programs are not supported.
  2. Executes the HFZLANGX utility to process the listing and store it as a side file. See Return codes for return codes issued by HFZLANGX.
  3. Writes the listing as part of the job output.

After you create and store a side file, you can discard the listing.

Figure 1. Sample JCL to compile a COBOL program and store the side file

//HFZSCMPS JOB (GSF),'GENERATE.SIDE.FILE',NOTIFY=&SYSUID.,
//         MSGCLASS=X,CLASS=A,MSGLEVEL=(1,1)
//         JCLLIB ORDER=(IGY.V2R1M0.SIGYPROC) <== INSTALLATION
//*                                                  IGYWCLG PROC
//*
//************************************************************/
//* THIS JOB RUNS A COBOL COMPILE PLUS PRODUCES A SIDE FILE  */
//* FROM A PROGRAM LISTING THAT Z ABEND INVESTIGATOR CAN     */
//* USE FOR OBTAINING SOURCE INFORMATION.                    */
//* THE COMPILED OUTPUT IS THEN WRITTEN TO SYSUT2 IN THE     */
//* IEBGENER STEP.                                           */
//************************************************************/
//*
//CBLRUN   EXEC IGYWC,PARM.COBOL='LIST,MAP,Source,XREF'
//COBOL.SYSIN DD DATA,DLM='##'
⋮
(Program source not shown)
⋮
##
//COBOL.SYSPRINT DD DSN=&&COBLIST(HFZSCBL1),
//         DISP=(,PASS),SPACE=(TRK,(10,5,5),RLSE),
//         DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0)
//*
//HFZLANGX EXEC PGM=HFZLANGX,REGION=4096K,
// PARM='HFZSCBL1 (COBOL ERROR'
//LISTING  DD  DISP=(OLD,PASS),DSN=&&COBLIST  ❶ 
//HFZLANGX DD  DISP=SHR,DSN=HFZ.HFZLANGX      ❷ 
//SYSUDUMP DD  SYSOUT=*
//*
//IEBGENER EXEC PGM=IEBGENER,REGION=4096K
//SYSUT1   DD  DISP=OLD,DSN=&&COBLIST(HFZSCBL1)
//SYSUT2   DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
/*Copy
Notes:
The DDname must be LISTING for all types of compiler listings, or SYSADATA for an assembler ADATA file.
The DDname must be HFZLANGX for the output LANGX side file. The data set must be sequential or PDS(E), RECFM=VB, LRECL≥1562.

Creating a side file from a listing

If you already have a listing, you can turn it into a side file. The JCL in Sample JCL to create a side file from a COBOL listing is provided as a sample in member HFZSFILE in the HFZ.SHFZSAM1 data set.

Figure 2. Sample JCL to create a side file from a COBOL listing

//HFZLANGX JOB (C97),'HFZLANGX',MSGCLASS=X,
//         CLASS=A,NOTIFY=&SYSUID
//*************************************************************
//* This job produces a side file from a program listing that
//* Z Abend Investigator can use to obtain source information.
//* This particular example is set up for a COBOL extraction
//* from HFZ.LISTING.COBOL(COBOLA)to HFZ.HFZLANGX
//*************************************************************
//HFZLANGX EXEC PGM=HFZLANGX,REGION=4096K,
// PARM='COBOLA (COBOL ERROR'
//LISTING  DD  DISP=SHR,DSN=HFZ.LISTING.COBOL  ❶ 
//HFZLANGX DD  DISP=SHR,DSN=HFZ.HFZLANGX       ❷ 
//SYSUDUMP DD  SYSOUT=*Copy
Notes:
The DDname must be LISTING for all types of compiler listings, or SYSADATA for an assembler ADATA file.
The DDname must be HFZLANGX for the output LANGX side file. The data set must be sequential or PDS(E), RECFM=VB, LRECL≥1562.

HFZLANGX parameters

The PARM string passed to HFZLANGX contains:

Figure 3. Syntax

1  PARM= '? mbr_name (language? 
2.1+ 
2.1 ERROR
2.1  PermitLangx + ,(msg_id) '
mbr_name
The compiler listing or ADATA file member name in the input data set identified by the LISTING DD name (for a compiler listing) or the SYSADATA DD name (if an ADATA file). This parameter is optional. If omitted, the JCL must specify for the compiler listing or ADATA file, either a sequential data set, or a PDS(E) data set with member name. Also, the output HFZLANGX member is named according to the input program name. In the case of COBOL, for example, this name is the name found on the PROGRAM-ID source line.
language
The language of the compiler listing or ADATA file, as one of the following keywords:
  • COBOL
  • PLI
  • C
  • ASM
This parameter is required.
ERROR
An optional parameter that provides more diagnostics on variables for which information is incomplete.
PermitLangx(msg_id, ...)
An optional parameter that specifies the message IDs of compiler error messages that should be ignored. Delimit multiple message IDs with either a comma or a blank. For additional information, see the Z Abend Investigator PermitLangx option.