File Manager Dumps For The COBOL Programmer
File Manager Dumps For The COBOL Programmer
In the November 2002 article I showed you how to use FileAid to print dumps which
utlilize a COBOL copy library member. In this article I will show you how to do the
same thing using IBM's File Manager. I will use the same file and copy library member I
used in the other article. The file is appropriately named JUNK. This file contains a label
in columns 1-8, a zoned decimal number in columns 9-11, and a packed decimal number
in columns 12-13. Here's the COBOL copy library member which describes this dataset:
01 JUNK-RECORD.
05 JR-LABEL PIC X(8).
05 JR-ZONED PIC 9(3).
05 JR-PACKED PIC S9(3) COMP-3.
Here are the second and third records of the file as viewed through ISPF with HEX ON.
Notice that record 3 contains a non-printable character in position 5 of JR-LABEL
(X'EE') and non-numeric data in JR-ZONED (all C'X') and in JR-PACKED (all C'Y').
-------------------------------------------------------------------
000002 SECOND 222
ECCDDC44FFF22
253654002222C
-------------------------------------------------------------------
000003 OOPS XXXYY
DDDEE444EEEEE
6672E00077788
-------------------------------------------------------------------
File Manager, like FileAid has the capability of producing a dump which shows the
records field-by-field, using the field names and formats as specified in the indicated
copy library member. The JCL is as follows:
//* JOBCARD
//******************************************************
//* FILE MANAGER JCL TO PRODUCE A FORMATTED DUMP. *
//* FORMAT IS DETERMINED BY A COBOL COPYBOOK MEMBER. *
//******************************************************
//FILEMGR EXEC PGM=FMNMAIN
//STEPLIB DD DSN=SYS2.FILEMGR.LOADLIB,DISP=SHR
// DD DSN=FMN.SFMNMOD1,DISP=SHR
// DD DSN=IBMZ.SIBMZCMP,DISP=SHR
// DD DSN=IGY.SIGYCOMP,DISP=SHR
// DD DSN=SYS1.SORTLPA,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
$$FILEM DSP FORMAT=SNGL, EACH RECORD SHOWN SEPARATELY
$$FILEM NLRECS=3, DUMP THREE RECORDS ONLY
$$FILEM TCIN=JCQUBX0.COPY(JUNKREC), COBOL COPYBOOK MEMBER
$$FILEM LANG=COBOL, COPYBOOK IS COBOL (VS. PLI)
$$FILEM DSNIN=JCQUBX0.JUNK THIS IS THE FILE TO BE DUMPED
//
The File Manager dump for the second and third records appears as follows. Whereas
FileAid shows non-printable characters in PIC X fields, and non-numeric in PIC 9 fields,
in their hexadecimal form, File Manager shows non-printable characters in PIC X fields
with periods, and non-numerics in PIC 9 fields as all asterisks. This makes FileAid more
useful in debugging, in my opinion.
Field Data
---------------------
Record Number - 2
JR-LABEL SECOND
JR-ZONED 222
JR-PACKED 222
Record Number - 3
JR-LABEL OOPS.
JR-ZONED ****
JR-PACKED ****