IDCAMS Print

IDCAMS Listcat IDCAMS Repro

Advertisements


PRINT command used to print the contents of a dataset.

The output can be made available on various formats like CHAR, HEX and DUMP.


Syntax:

						
 PRINT {INFILE(ddname[/password])|                                 
	   INDATASET(entryname[/password])}                          
	 [CHARACTER|DUMP|HEX]                                        
	 [FROMKEY(key)|FROMADDRESS(address)|                         
	   FROMNUMBER(number)|SKIP(number)]                          
	 [OUTFILE(ddname)]                                           
	 [TOKEY(key)|TOADDRESS(address)|                             
	   TONUMBER(number)|COUNT(number)]          
                                                       

PRINT-CHAR/HEX/DUMP: This specifies the format of the output in which format(CHAR/HEX/DUMP) it is going to print.

PRINT-SKIP, COUNT, FROM and TO: The above option is used to select the records to be printed can be selected in the same way records are selected in REPRO to COPY.


Where to start printingWhere to stop printingWhere used
SKIP(number)COUNT(number)KSDS, ESDS, RRDS, NON-VSAM
FROMKEY(key-values)TOKEY(key-value)KSDS, ALTERNATE INDEX
FROMADDRESS(RBA)TOADDRESS(RBA)KSDS, ESDS
FROMNUMBER(RRN)TONUMBER(RRN)RRDS

Empty file-check:


The major advantage of PRINT command is to check particular file is empty or not.

If the file is empty, PRINT COUNT (1) ends with return-code as 4.


Practical Example:


						
//JOB CARD
//*------------------------------------------------------------------
//* IDCAMS - PRINT
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//INPUT    DD   DSNAME=userid.KSDS.INPUT,DISP=SHR
//SYSIN     DD *
   PRINT -
           INDATASET(INPUT)
/*



IDCAMS Listcat IDCAMS Repro

Advertisements