SORT FIELDS=(15,6,ZD,A)
OUTFIL FNAMES=USA,
HEADER2=(5:'Parts Completion Report for USA',2/,
5:'Printed on ',DATE,
' at ',TIME=(12:),3/,
5:'Part ',20:'Completed',35:' Value ($)',/,
5:'------',20:'---------',35:'------------'),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M12,LENGTH=9,
35:38,8,ZD,M18,LENGTH=12,
132:X)
OUTFIL FNAMES=FRANCE,
HEADER2=(5:'Parts Completion Report for France',2/,
5:'Printed on ',DATE=(DM4/),
' at ',TIME,3/,
5:'Part ',20:'Completed',35:' Value (F)',/,
5:'------',20:'---------',35:'------------'),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M16,LENGTH=9,
35:38,8,ZD,M22,LENGTH=12,
132:X)
OUTFIL FNAMES=DENMARK,
HEADER2=(5:'Parts Completion Report for Denmark',2/,
5:'Printed on ',DATE=(DMY-),
' at ',TIME=(24.),3/,
5:'Part ',20:'Completed',35:' Value (kr)',/,
5:'------',20:'---------',35:'------------'),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M13,LENGTH=9,
35:38,8,ZD,M19,LENGTH=12,
132:X)
This example illustrates how reports for three different countries
can be produced from sorted fixed-length input records. The reports
differ only in the way that date, time, and numeric formats are specified:
- The first OUTFIL statement produces a report that has the date,
time, and numeric formats commonly used in the United States.
- The second OUTFIL statement produces a report that has the date,
time, and numeric formats commonly used in France.
- The third OUTFIL statement produces a report that has the date,
time, and numeric formats commonly used in Denmark.
Of course, any one of the three reports can be produced by itself
using a single OUTFIL statement instead of three OUTFIL statements.
(This may be necessary if you are sorting character data according
to a specified locale for that country.)
The FNAMES parameter specifies the ddname (USA, FRANCE, DENMARK)
associated with the fixed-length data set for that report.
The HEADER2 parameter specifies the page header to appear at the
top of each page for that report, which will consist of:
- A line of text identifying the report. Note that all English
text in the report can be replaced by text in the language of that
country.
- A blank line (2/).
- A line of text showing the date and time. Note that variations
of the DATE, DATE=(abcd), TIME, and TIME=(abc) operands are used
to specify the date and time in the format commonly used in that country.
- Two blank lines (3/).
- Two lines of text showing headings for the columns of data. Note
that the appropriate currency symbol can be included in the text.
The OUTREC parameter specifies the three columns of data to appear
for each input record as follows:
- A 6-byte edited numeric value produced by transforming the ZD
value in bytes 15 through 20 according to the pattern specified by
M11. M11 is a pattern for showing integers with leading zeros.
- A 9-byte (LENGTH=9) edited numeric value produced by transforming
the ZD value in bytes 3 through 6 according to the pattern for integer
values with thousands separators commonly used in that country. M12
uses a comma for the thousands separator. M16 uses a blank for the
thousands separator. M13 uses a period for the thousands separator.
- A 12-byte (LENGTH=12) edited numeric value produced by transforming
the ZD value in bytes 38 through 45 according to the pattern for decimal
values with thousands separators and decimal separators commonly used
in that country. M18 uses a comma for the thousands separator and
a period for the decimal separator. M22 uses a blank for the thousands
separator and a comma for the decimal separator. M19 uses a period
for the thousands separator and a comma for the decimal separator.
Table 8 shows the twenty-seven pre-defined edit
masks (M0-M26) from which you can choose.
132:X is used at the end of the OUTREC parameter to ensure that
the data records are longer than the report records. This will result
in an LRECL of 132 for the fixed-length OUTFIL data sets (1 byte for
the ANSI control character and 131 bytes for the data).
The three reports might look as follows:
Parts Completion Report for USA
Printed on 03/25/05 at 01:56:20 pm
Part Completed Value ($)
------ --------- ------------
000310 562 8,317.53
001184 1,234 23,456.78
029633 35 642.10
192199 3,150 121,934.65
821356 233 2,212.34
Parts Completion Report for France
Printed on 25/03/2005 at 13:56:20
Part Completed Value (F)
------ --------- ------------
000310 562 8 317,53
001184 1 234 23 456,78
029633 35 642,10
192199 3 150 121 934,65
821356 233 2 212,34
Parts Completion Report for Denmark
Printed on 25-03-05 at 13.56.20
Part Completed Value (kr)
------ --------- ------------
000310 562 8.317,53
001184 1.234 23.456,78
029633 35 642,10
192199 3.150 121.934,65
821356 233 2.212,34