INPUT
From CometWiki
(New page: INPUT Syntax: INPUT dictionary-file-name [(alternate-actual-file-name{,directory-name})] Placement: Place the INPUT command before the REPORT command and after any LOG, PRINTER, or DI...) |
|||
Line 1: | Line 1: | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | The alternate-actual-file-name and directory-name parameters are optional, and are used to specify an alternate input file for the report. For example, the data dictionary (#CFILES) may contain a description for a file named CUSTOMER whose actual file name is C1A on directory DSK. For the purposes of a specific report, an alternate file name and directory name can be specified, as follows: | + | == INPUT == |
+ | |||
+ | '''Syntax:''' <br> INPUT dictionary-file-name [(alternate-actual-file-name{,directory-name})] <br> | ||
+ | '''Placement:''' <br> Place the INPUT command before the REPORT command and after any LOG, PRINTER, or DICTIONARY commands. <br> | ||
+ | '''Discussion:'''<br> INPUT specifies the name of the primary file for your report.<br> Once the primary file is declared with the INPUT command, you can use all fields from that file with the following commands: | ||
+ | BREAK | ||
+ | DEFINE | ||
+ | PRINT | ||
+ | SELECTING | ||
+ | SORT | ||
+ | TOTAL | ||
+ | |||
+ | '''Note:'''<br> Each report may have only one primary file.<br> Other files used in preparing the report are considered "secondary" files, and must be linked to the primary file with a USING command. | ||
+ | |||
+ | The alternate-actual-file-name and directory-name parameters are optional, and are used to specify an alternate input file for the report.<br> For example, the data dictionary (#CFILES) may contain a description for a file named CUSTOMER whose actual file name is C1A on directory DSK.<br> For the purposes of a specific report, an alternate file name and directory name can be specified, as follows: | ||
INPUT CUSTOMER(TEMPFILE,ABC) | INPUT CUSTOMER(TEMPFILE,ABC) | ||
- | In this case, the data dictionary field descriptions for the CUSTOMER file will be used, but the file named TEMPFILE on directory ABC will be used as the actual input file for the report. | + | In this case, the data dictionary field descriptions for the CUSTOMER file will be used, but the file named TEMPFILE on directory ABC will be used as the actual input file for the report. <br> |
- | Example 1: | + | '''Example 1:''' |
+ | 100 INPUT CUSTOMER | ||
200 TITLE PAST.DUE.ACCOUNTS | 200 TITLE PAST.DUE.ACCOUNTS | ||
300 DEFINE PAST.DUE = AR.OVER.60 + AR.OVER.90;8.2;PAST DUE | 300 DEFINE PAST.DUE = AR.OVER.60 + AR.OVER.90;8.2;PAST DUE | ||
Line 27: | Line 31: | ||
1000 TOTAL PAST.DUE;PREVIOUS.YTD | 1000 TOTAL PAST.DUE;PREVIOUS.YTD | ||
1100 END | 1100 END | ||
- | |||
- | Example 2: | + | '''Example 2:''' |
+ | 100 INPUT CUSTOMER(TEMPFILE,ABC) | ||
200 TITLE PAST.DUE.ACCOUNTS | 200 TITLE PAST.DUE.ACCOUNTS | ||
300 DEFINE PAST.DUE = AR.OVER.60 + AR.OVER.90;8.2;PAST DUE | 300 DEFINE PAST.DUE = AR.OVER.60 + AR.OVER.90;8.2;PAST DUE |
Latest revision as of 09:32, 6 June 2009
INPUT
Syntax:
INPUT dictionary-file-name [(alternate-actual-file-name{,directory-name})]
Placement:
Place the INPUT command before the REPORT command and after any LOG, PRINTER, or DICTIONARY commands.
Discussion:
INPUT specifies the name of the primary file for your report.
Once the primary file is declared with the INPUT command, you can use all fields from that file with the following commands:
BREAK DEFINE PRINT SELECTING SORT TOTAL
Note:
Each report may have only one primary file.
Other files used in preparing the report are considered "secondary" files, and must be linked to the primary file with a USING command.
The alternate-actual-file-name and directory-name parameters are optional, and are used to specify an alternate input file for the report.
For example, the data dictionary (#CFILES) may contain a description for a file named CUSTOMER whose actual file name is C1A on directory DSK.
For the purposes of a specific report, an alternate file name and directory name can be specified, as follows:
INPUT CUSTOMER(TEMPFILE,ABC)
In this case, the data dictionary field descriptions for the CUSTOMER file will be used, but the file named TEMPFILE on directory ABC will be used as the actual input file for the report.
Example 1:
100 INPUT CUSTOMER 200 TITLE PAST.DUE.ACCOUNTS 300 DEFINE PAST.DUE = AR.OVER.60 + AR.OVER.90;8.2;PAST DUE 400 SELECTING IF PAST.DUE GT 0 500 SORT ON STATE;CUST.NAME 600 REPORT 700 USING CUST.TO.HIST 800 PRINT CUST.NAME;CUST.NUMBER;STATE;PREVIOUS.YTD;PAST.DUE 900 BREAK ON STATE 1000 TOTAL PAST.DUE;PREVIOUS.YTD 1100 END
Example 2:
100 INPUT CUSTOMER(TEMPFILE,ABC) 200 TITLE PAST.DUE.ACCOUNTS 300 DEFINE PAST.DUE = AR.OVER.60 + AR.OVER.90;8.2;PAST DUE 400 SELECTING IF PAST.DUE GT 0 500 SORT ON STATE;CUST.NAME 600 REPORT 700 USING CUST.TO.HIST 800 PRINT CUST.NAME;CUST.NUMBER;STATE;PREVIOUS.YTD;PAST.DUE 900 BREAK ON STATE 1000 TOTAL PAST.DUE;PREVIOUS.YTD 1100 END