Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

sdfrd Read and analyze statement

&pagelevel(5)&pagelevel

The sdfrd 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, logging 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.

This presupposes 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").

Since the function has a number of optional parameters, there are 5 different formats.

Format 1:


int sdfrd (char *area);


Format 2:


int sdfrdmsg (char *area, char *msg);


Format 3:


int sdfrdall (char *area, char *msg, char *allow);


Format 4:


int sdfrdpre (char *area, char *msg, char *allow, STR8 prefer);


Format 5:


int sdfrddef  (char *area, char *msg, char *allow, STR8 prefer, char *def1,

char *def2, char *def3, char *def4, char *def5);


Description of the parameters

char *area

Pointer to the buffer in which the standardized transfer area was
created (see sdfinit).

char *msg

Pointer to a message to be output before the statement is read.
SDF internally converts the string into a variable-length record.
The string must be no more than 400 characters long.
If a NULL pointer is specified, no message is displayed.

char *allow

Pointer to the list of valid statements
(must be aligned on word boundary).

Format of list of valid statements:

N | statement 1 | statement 2 | .....  | statement n

N(2 bytes) : number of statements in the list
statementx(8 bytes) : internal name of a valid statement

STR8 prefe

Only in guided dialog: internal name of the statement expected next,
8 characters long, with zero (’\0’) as the last character.

char *def1,*def2,*def3,*def4,*def5Pointers to up to 5 conversion descriptions with which default
values of operands can be replaced by values generated
dynamically by the program. A value must be specified for each
of the 5 pointers. Pointers not needed must be specified as NULL
pointers. All pointers after the first NULL pointer are ignored.


Result

The function returns an integer as its result (see "Description of the C functions").

Read and convert default values

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 an sdfrd call executed beforehand or by an sdftr call in which the new values are entered. This description has the format of a standardized transfer area.