The CIO block, CIOF block, and user parameters are described separately in this section.
The CIO block contains return codes that indicate the presence of invalid CIO or CIOF parameters and specify the outcome of the RETURN operation from the compiler to the user program. This block also contains a value that indicates which compiler is in error. The CIO block is formatted as follows:
|
Field |
Label |
Usage |
Size |
Picture |
Description |
|---|---|---|---|---|---|
|
1 |
CIOID |
Char |
4 |
X(4) |
Compiler I/O ID; must be initialized to 'CIO' |
|
2 |
CIOUSER |
Binary |
4 |
S9(8) COMP |
Reserved for user storage (normally, an address); must be initialized to 0 |
|
3 |
CIOIORC |
Binary |
4 |
S9(8) COMP |
CIO return code |
|
4 |
CIOCMPRC |
Binary |
4 |
S9(8) COMP |
Compiler return code |
|
5 |
|
Char |
8 |
X(8) |
Reserved |
|
6 |
CIOERRFI |
Char |
8 |
X(8) |
If an error has occurred, the name of the file in error |
Error conditions are returned to the calling program as a return code in the CIOIORC field of the CIO block. These error codes are described as follows:
|
Error code |
Description |
|---|---|
|
4 (X'04') |
An invalid parameter has been passed to the compiler interface; typically, the CIO or CIOF block has not been properly initialized. |
|
8 (X'08') |
The scratch id or queue id specified in the CIOF block could not be found. |
|
28 (X'1C') |
An I/O error has occurred during an attempt to access a scratch area or queue file, or an output work-area file is exhausted. |
The name of the file in error (SYSIPT, SYSLST, or SYSPCH) is placed in the CIOERRFI field of the CIO block for examination by the user.
For each file, the user program passes a CIOF block. Each CIOF block describes the type of file being passed (for example, work area); the number of records to be read from and written to the file; and the maximum number of records the file can hold. The format of the CIOF block is as shown in the following table.
|
Field |
Label |
Usage |
Size |
Picture |
Description |
|---|---|---|---|---|---|
|
1 |
CIOFTYPE |
Char |
8 |
X(8) |
File type for data block (see next table) |
|
2 |
CIOFNAME |
Char |
16 |
X(16) |
File name (see next table) |
|
3 |
CIOFRC |
Binary |
4 |
S9(8) COMP |
Program return code, if file type is 'LINKPGM'/ 'LINKEPA'. |
|
4 |
CIOFZUS |
Binary |
4 |
S9(8) COMP |
Number of records read from or written to file; updated if file type is 'WORKAREA', 'SCRATCH', or 'QUEUE'; can also be updated by program if file type is 'LINKPGM'/'LINKEPA'. |
|
5 |
CIOFSZMX |
Binary |
4 |
S9(8) COMP |
If file type is 'WORKAREA', maximum number of records that file holds (SYSIPT) or can hold (SYSLST or SYSPCH). |
Fields 1 and 2
The following table provides guidelines for determining file types and names for fields 1 and 2 of the CIOF block.
|
File type |
File name |
|---|---|
|
For a work area initialize to 'WORKAREA' |
Not applicable |
|
For a scratch area initialize to 'SCRATCH ' |
Scratch area ID |
|
For a queue initialize to 'QUEUE ' |
Queue ID |
|
For a program initialize to 'LINKPGM ' or 'LINKEPA', based on the LINK mechanism used |
If 'LINKPGM' use the 8-character program name If 'LINKEPA' use the 4-character entry point address |
|
For a null file initialize to 'NULL' |
Not applicable |
Each CIOF block must be followed by a user parameter that specifies the location of the work-area file within program variable storage or defines the parameter list to be passed to the user program exit. The user parameters and the information passed in each are as follows:
|
Parameter |
Information passed |
|---|---|
|
1 |
CIO block |
|
2 |
CIOF block for input file |
|
3 |
If CIOFTYPE='WORKAREA', the work area allocated in program variable storage; if CIOFTYPE='LINKPGM' or 'LINKEPA', parameter list to be passed to the user exit; otherwise, this should be the literal 'NULL' |
|
4 |
CIOF block for the output print file |
|
5 |
If CIOFTYPE='WORKAREA', the work area allocated in program variable storage; if CIOFTYPE='LINKPGM' or 'LINKEPA', the parameter list to be passed to the user exit; otherwise, this should be the literal 'NULL' |
|
6 |
CIOF block for the output punch file |
|
7 |
If CIOFTYPE='WORKAREA', the work area allocated in program variable storage; if CIOFTYPE='LINKPGM' or 'LINKEPA', the parameter list to be passed to the user exit; otherwise, this should be the literal 'NULL' |
|
Copyright © 2014 CA.
All rights reserved.
|
|