──┬─ DATA ───┬─<file name constant>────────────────────────────────────► └─ EBCDIC ─┘ ►─<data images>────────────────────────────────────────────────────────► ►─<i>──────────────────────────────────────────────────────────────────┤
<data images>
One or more card images or records of EBCDIC data, none of which can contain a question mark (?) in the first column.
Explanation
A global data specification contains data that can be used as input by programs initiated in the job. The global data specification is read as if it were a card reader input file, and can be closed and reopened or read by more than one task.
The file name constant identifies the global data specification. The file name constant cannot contain a usercode or an asterisk (*).
The data images must be of the type specified at the start of the global data specification. The types of global data specifications are defined as follows:
Data Type |
Meaning |
DATA |
Allows any characters in the EBCDIC character set. |
EBCDIC |
A synonym for DATA. |
The data images should begin on the line or card image following the global data specification heading.
Note: | Any data following the heading on the same line is ignored. |
Tasks are read from the global data specification as if they were an input file, and each line of data images is treated as a new record of the input file. A record in a disk file created by CANDE with a FILEKIND=JOBSYMBOL contains data in columns 1 through 80, spaces in columns 81 and 82, and the sequence number in columns 83 through 90. Since the default MAXRECSIZE that a program uses when reading these data images is 14 words (84 characters), care must be taken to ensure that unwanted characters are not included in the data.
Note: | To ensure that no unwanted information is read from columns 81 through 84 of the data images, equate UNITS to CHARACTERS and MAXRECSIZE to 80. |
The <i> construct that terminates the global data specification also separates the data specification from the next declaration or statement; it is not necessary to follow the data specification with a semicolon (;).
For a global data specification to be used by a task, the task initiation statement should contain a file equation equating the TITLE file attribute to the file name constant specified in the global data specification. The file equation should also equate the KIND attribute of the file to READER.
When more than one task uses the same global data specification as input, each task begins reading at the start of the deck. WFL also enables you to use local data specifications, which provide input for a single task only. Refer to Local Data Specifications for a further description of this capability.
A global data specification can appear only in jobs stored in disk files and initiated by a START statement.
Note: | Global data specifications can occur only in the outer block of a job; that is, they cannot be declared in subroutines. |
Example
The following job uses a global data specification:
?BEGIN JOB SURF/METER; DATA WAVE/HEIGHTS % Begin global data specification 3.5 1.2 23.4 ? % End global data specification RUN (WALLY)SURF/ANALYZE; FILE WAVEIN(TITLE=WAVE/HEIGHTS,KIND=READER); RUN (WALLY)SURF/REPORT; FILE WAVES(TITLE=WAVE/HEIGHTS,KIND=READER); ?END JOB.