PRINT sub-command


Defines the segment special processing options, frequency, print fields, and print format processing for the purpose of printing the selected segments.

image2021-3-11_12-38-25.png

OPTION

Defines special processing.

For more information, see Processing-paths.

  • FPRT/SPRT Formatted mode/unformatted mode.
  • ALWAYS Process for either PATH or NOPATH condition.
  • PATH Process only if the specified path exists.
  • NOPATH Process only if the specified path does not exist.
  • SGM/NOSGM Print/do not print segment option.

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.

TYPE   RUN;
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.

TYPE   RUN;
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

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*