PRINT sub-command
Defines the segment special processing options, frequency, print fields, and print format processing for the purpose of printing the selected segments.
OPTION | Defines special processing. For more information, see Processing-paths.
|
FIELD | Specifies the fields in the selected segment to be printed. Must consist of a COBOL or PL/I field name within the specified segment layout. FLDNAME can contain a reference for the field occurrence. |
Examples
The following PRINT sub-command statement prints every 100th segment starting at the 100th segment. A total of 10 segments are printed.
PSB DBNAME=CUSTPDBD XREF=CUSTXRF1;
TITLE LINE01=’PRINT CUSTOMER INFORMATION IN DIFFERENT FORMATS’;
SELECT SEGMENT=$ROOT MAX=10 START=100 SKIP=(1,99)
CHILD MAX=ALL
PRINT SEGMENT=$ROOT FIELD=(CUST-NUMBER,CUST-NAME,CUST-BALANCE)
CHILD OPTION=SPRINT;
The first statement in the following example prints the selected field from the 200th customer segment and then prints the customer orders. The second statement prints all remark segments for 10 customers without printing the customer segment.
PSB PCB=4;
TITLE LINE02=’PRINT ALL ORDER FOR THE 200TH CUSTOMER’;
SELECT SEGMENT=$ROOT START=200 MAX=1
SEGMENT=CUSTORDR MAX=ALL
PRINT SEGMENT=$ROOT OPTION=FPRINT
FIELD=(CUST-NUMBER,CUST-NAME,CUST-BALANCE)
SEGMENT=CUSTORDR;
TITLE LINE03=’PRINT REMARKS ONLY’;
SELECT SEGMENT=CUSTOMER MAX=10
SEGMENT=CUSTRMKS MAX=ALL
PRINT SEGMENT=CUSTOMER OPTION=(NOSGM)
SEGMENT=CUSTRMKS;
Related topics