Example 7
SORT FROM(PARTS) TO(TEMP) USING(SRT1)
DISPLAY FROM(TEMP) LIST(USA) -
TITLE('Parts Completion Report for USA') DATE -
HEADER('Part') HEADER('Completed') HEADER('Value ($)') -
ON(15,6,CH) ON(3,4,ZD,A1) ON(38,8,ZD,C1) -
TOTAL('Total:')
DISPLAY FROM(TEMP) LIST(FRANCE) -
TITLE('Parts Completion Report for France') DATE(DM4/) -
HEADER('Part') HEADER('Completed') HEADER('Value (F)') -
ON(15,6,CH) ON(3,4,ZD,A3) ON(38,8,ZD,C3) -
TOTAL('Total:')
DISPLAY FROM(TEMP) LIST(DENMARK) -
TITLE('Parts Completion Report for Denmark') DATE(DMY-) -
HEADER('Part') HEADER('Completed') HEADER('Value (kr)') -
ON(15,6,CH) ON(3,4,ZD,A2) ON(38,8,ZD,C2) -
TOTAL('Total:')
This example shows how reports for three different countries can be produced. The reports differ only in the way that date and numeric values are displayed.
SORT FIELDS=(15,6,CH,A)
The SORT operator sorts the PARTS data set to the TEMP data set using the SORT statement in SRT1CNTL.
- A title line containing the specified title and the date in the format commonly used in the United States
- A heading line containing the specified underlined headings
- Data lines containing:
- The characters from positions 15-20
- The zoned decimal values from positions 3-6 formatted with the separators commonly used in the United States
- The zoned decimal values from positions 38-45 formatted with two decimal places and the separators and decimal point commonly used in the United States.
- A TOTAL line containing the specified string and the total for each of the two zoned decimal fields formatted in the same way as the data values.
- A title line containing the specified title and the date in the format commonly used in France
- A heading line containing the specified underlined headings
- Data lines containing:
- The characters from positions 15-20
- The zoned decimal values from positions 3-6 formatted with the separators commonly used in France
- The zoned decimal values from positions 38-45 formatted with two decimal places and the separators and decimal point commonly used in France.
- A TOTAL line containing the specified string and the total for each of the two zoned decimal fields formatted in the same way as the data values.
- A title line containing the specified title and the date in the format commonly used in Denmark
- A heading line containing the specified underlined headings
- Data lines containing:
- The characters from positions 15-20
- The zoned decimal values from positions 3-6 formatted with the separators commonly used in Denmark
- The zoned decimal values from positions 38-45 formatted with two decimal places and the separators and decimal point commonly used in Denmark.
- A TOTAL line containing the specified string and the total for each of the two zoned decimal fields formatted in the same way as the data values.
The USA output starts on a new page and looks as follows (several records are shown with illustrative values):
Parts Completion Report for USA 01/14/05
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
Total: 5,214 156,563.40
The title line and underlined heading line appear at the top of each page.
The FRANCE output starts on a new page and looks as follows (several record are shown with illustrative values):
Parts Completion Report for France 14/01/2005
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
Total: 5 214 156 563,40
The title line and underlined heading line appear at the top of each page.
The DENMARK output starts on a new page and looks as follows (several records are shown with illustrative values):
Parts Completion Report for Denmark 14-01-05
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
Total: 5.214 156.563,40
The title line and underlined heading line appear at the top of each page.