Previous Topic: Demonstration (2): Converting to Packed Decimal FormatNext Topic: Demonstration (4): Writing Totals-only


Demonstration (3): Writing Complete Records

Objective

This example writes input records to a file by defining the entire input record on one REC parameter.

Procedure

Complete Code

col. 2
▼
IN 80 F 400
REC CUST-NO       1     9  2
REC TYPE         38     3
REC ENTIRE-RECORD 1     40 $Defines all input fields
01OUT 80 D
01SORT CUST-NO
01510001 ENTIRE-RECORD
017010   IF TYPE = ('E00' TO 'T99') DROP

Result

0010766150002469000002222000144523008A27 0010766150000525000000474250283356401B44 0010766150001559000001327500324836977B49 0013269680000385000000355000422283501B27 0013269680023950000021950000144523008A27 0013269680000909500000811500262973310B52 0058856830000000000000022000424304486X12 0058856830001000000000850000262973311B52 0058856830004450000004005000669011172C06