The READ function causes SDF
to read a program statement from SYSSTMT. (The assignment for the SYSDTA system file also applies to SYSSTMT. The rules governing continuation lines, continuation characters and comments in SYSSTMT are the same as those that apply to SYSCMD.)
analyze the statement read in and
transfer the result of this analysis to the program.
The precondition is that an activated syntax file contains the definition of the program and its statements. For details, see the description of the RDSTMT macro ("RDSTMT Read and analyze statement").
Call
CALL SDF('READ',area,error[,msg[,allow[,prefer[,default1,...]]]])
Description of the parameter list
Parameter | Data type | Input/ | Meaning |
READ | char(4) | in | Function name: keyword READ |
area | char() | inout | Buffer for creating the standardized transfer area (see INIT) |
error | integer | out | Return code |
msg | V-rec@ | in | Address of a variable-length record containing the text of a message to be output before the statement is read (max. 400 characters in length) |
allow | ptr | in | Address of a structure containing the list of valid statements1) |
prefer | char(8) | in | Only in guided dialog: internal name of the statement expected next |
default1, | char() | in | List of up to 5 conversion descriptions with which default values of operands can be replaced by values generated dynamically by the program 2) |
1) Format of the list of valid statements:
N | statement1 | statement2 | ..... | statementn |
N | (2 bytes) : | number of statements in the list |
statement x | (8 bytes) : | internal name of a valid statement |
2) With the aid of conversion descriptions, default values of operands defined in the syntax file with ADD-VALUE ...,VALUE=<c-string>...(OVERWRITE-POSSIBLE=*YES) or ADD-OPERAND...,OVERWRITE-POSSIBLE=*YES can be replaced by values generated dynamically by the program. Only one conversion description can be specified per statement. The conversion description contains the internal statement name and the information defining which operand values can be replaced and how. A conversion description can be generated either by a READ call executed beforehand or by a TRNS call in which the new values are entered. The description has the format of a standardized transfer area.
The ’area’ buffer contains pointers to absolute addresses. Consequently, it cannot be copied into another memory area for evaluation.
If a zero (address=0 or blank string) is specified for the parameters msg, allow and prefer, the corresponding value is ignored.
The following are ignored:
a statement name beginning with a blank ““ specified for prefer
a record of length 0 specified for msg
a list containing 0 elements specified for allow.
The RDSTMT macro is called with the following defaults:
PROT=*YES
BUFFER=*NO
INVAR=*NO
SPIN=*NO
ERRSTMT=*STEP
CALLID=*NO
CCSNAME=*NO