The data entered via SYSDTA is edited and output in the LIST file.
/CREATE-FILE FILE-NAME=LIST /ADD-FILE-LINK LINK-NAME=PCOUT,FILE-NAME=LIST,ACCESS-METHOD=*SAM &*—————— (1) /START-PERCON &*————————————————————————————————————————————————————————— (2) % PER0000 PERCON STARTED, VERSION V03.0A00 //ASSIGN-INPUT-FILE FILE=*SYSDTA &*—————————————————————————————————————— (3) //ASSIGN-OUTPUT-FILE FILE=*DISK-FILE(NAME=LIST) &*——————————————————————— (4) //SET-RECORD-MAPPING - &*———————————————————————————————————————————————— (5) // OUTPUT-FIELDS=(- // *GROUP-COUNTER(LINK-NAME=PCOUT,- // GROUP-LEVEL=1,- // OUTPUT-POSITION=10),- // '/'(OUTPUT-POSITION=16),- // *FIELD(INPUT-POSITION=5,- // INPUT-LENGTH=10,- // OUTPUT-POSITION=22),- // '/'(OUTPUT-POSITION=35),- // *FIELD(INPUT-POSITION=15,- // INPUT-LENGTH=3,- // INPUT-FORMAT=*ZONED-DECIMAL,- // OUTPUT-POSITION=40,- // OUTPUT-FORMAT=' ZNZ')) //SET-GROUP-ATTRIBUTES - &*—————————————————————————————————————————————— (6) // GROUP-TRAILER=(- // *SPACING(LINES=4),- // 'Items :'(OUTPUT-POSITION=10),- // *GROUP-COUNTER(LINK-NAME=PCOUT,- // GROUP-LEVEL=1,- // OUTPUT-POSITION=25,- // OUTPUT-FORMAT=' ZZZNZ'),- // *SPACING,- // 'Total number:'(OUTPUT-POSITION=10),- // *SUM-FIELD(INPUT-POSITION=15,- // INPUT-LENGTH=3,- // INPUT-FORMAT=*ZONED-DECIMAL,- // OUTPUT-POSITION=25,- // OUTPUT-FORMAT=' ZZZNZ')) //SET-PAGE-LAYOUT HEADER-LINE=*NONE &*——————————————————————————————————— (7) //END &*————————————————————————————————————————————————————————————————— (8) Suit 014 ——————————————————————————————————————————————————————————— (9) Pants 053 Shirt 162 Blouse 064 Shoes 136 /EOF % PER0030 NUMBER OF PROCESSED RECORDS FOR LINK 'PCIN' : 5 % PER0030 NUMBER OF PROCESSED RECORDS FOR LINK 'PCOUT' (FILE=LIST): 5 % PER0031 PERCON TERMINATED NORMALLY ——————————————————————————————————— (10)
(1) | The output file LIST is assigned with the link name PCOUT. |
(2) | PERCON is called. |
(3) | Input is to be made via SYSDTA. |
(4) | The output file LIST is assigned. |
(5) | The group counter and certain fields of the input record are transferred to the output record by means of the SET-RECORD-MAPPING statement. |
(6) | The SET-GROUP-ATTRIBUTES statement defines the format and contents of the group trailer lines. |
(7) | The SET-PAGE-LAYOUT statement specifies that no header line is to be output. |
(8) | The END statement starts the transfer procedure and terminates PERCON. |
(9) | Input of the data via SYSDTA. |
(10) | PERCON is terminated normally. |
Contents of the output file LIST:
The position scale is not contained in the file and refers only to the data, i.e. record length field and feed control characters are not taken into account.
5 10 15 20 25 30 35 40 45 50 (Position scale) ----+----+----+----+----+----+----+----+----+----+ 1 / Suit / 14 2 / Pants / 53 3 / Shirt / 162 4 / Blouse / 64 5 / Shoes / 136 Items : 5 Total number: 429