INPUT

From CometWiki

Jump to: navigation, search

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
Personal tools