Print Command.


PRINT command:
·        The PRINT command is used to print the contents of both VSAM and non-VSAM datasets.

·        Syntax for the command:

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)] 

·        The only required parameter is either INFILE or INDATASET to specify the dataset from which records are to be printed. 

·        INFILEà DD name specified from which data is to be read.
·        INDATASETà The Actual dataset name.

·        FROMKEY, FROMADDRESS, FROMNUMBER, TOKEY, TONUMBER, TOADDRESS are the same as explained earlier.

·        OUTPut format:
§  CHARACTER specifies that each byte in the logical record is to be printed as a character. 
§  DUMP specifies that each byte in the logical record is to be printed in both hexadecimal and character format. 
§  HEX specifies that each byte in the logical record is to be printed as two hexadecimal digits.

Example For printing file:

***************************** Top of Data *****************
//JOB00011 JOB (XXXX),'ACCESS METHOD',NOTIFY=SYSUID       
//STEP0001 EXEC PGM=IDCAMS                                
//SYSPRINT DD   SYSOUT=*                                  
//SYSIN    DD *                                           
     PRINT INDATASET(SM017R.TEST.VSAM2) DUMP              
/*                                                        
**************************** Bottom of Data ***************

Output:
LISTING OF DATA SET -SM017R.TEST.VSAM2                                
                                                                       
RBA OF RECORD -                0                                      
000000  40F2E2E4 D2E4D340 C9E240E5 C5D9E840   C7D9C5C1 E3404040 4040404
000020  40404040 40404040 40404040 40404040   40404040 40404040 4040404
000040  40404040 40404040 F0F0F0F0 F0F6F0F8                           
                                                                      
* 2SUKUL IS VERY GREAT           *
 *                                *
 *        00000608                *
IDC0005I NUMBER OF RECORDS PROCESSED WAS 1                            

As you can see in the output it shows both actual data and the hexadecimal dump.

If we  use only CHARACTER it will print data is character format to the output dataset.

No comments:

Post a Comment