Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

SET-PROCEDURE-OPTIONS Set procedure attributes

&pagelevel(4)&pagelevel

Domain: PROCEDURE

Command description

The SET-PROCEDURE-OPTIONS command serves to define the attributes of an
S procedure. The command is optional. If used, however, it must be the first command in the procedure head. If no SET-PROCEDURE-OPTIONS command is specified, the SDF-P default settings for procedure attributes apply. The following attributes can be defined by means of the SET-PROCEDURE-OPTIONS command (the SDF-P default settings are given in parentheses):

  • valid procedure call (CALLER=*ANY)

  • implicit declaration of S variables (IMPLICIT-DECLARATION=*YES)

  • extent of logging (LOGGING=*YES)

  • procedure interruption (INTERRUPT-ALLOWED=*YES)

  • procedure format (INPUT-FORMAT=*FREE-RECORD-LENGTH)

  • variable replacement within data records (DATA-ESCAPE-CHAR=*NONE)

  • SYSFILE environment of the current procedure level
    (SYSTEM-FILE-CONTEXT=*STD)

  • error handling in the event of mixed data and command lines
    (DATA-ERROR-HANDLING=*YES)

  • setting for job variable replacement
    (default for interactive mode: JV-REPLACEMENT=*AFTER-BUILTIN-FUNCTION; for S procedures: JV-REPLACEMENT=*NO)

  • setting for error handling (ERROR-MECHANISM=*SPIN-OFF-COMPATIBLE)

  • suppression of selected SDF-P messages (SUPPRESS-SDP-MSG=*NONE)

  • Coded character set (CCS) for conversion of lower case letters to  upper case letters and vice versa (TRANSLATION-CCS=*STD)

Notes

  • Explicit specification via the SET-PROCEDURE-OPTIONS command is required if defaults that are modified in the activated syntax file are to take effect for the procedure.

  • SET-PROCEDURE-OPTIONS may be called no more than once and only as the first command in the procedure (see also section “Creating the procedure head”).

Format

SET-PROCEDURE-OPTIONS

CALLER = *ANY / *CALL / *INCLUDE /

,IMPLICIT-DECLARATION = *YES / *NO

,LOGGING-ALLOWED = *PARAMETERS(...) / *YES / *NO

*PARAMETERS(...)

CMD = *YES / *NO

,DATA = *YES / *NO

,INTERRUPT-ALLOWED = *YES / *NO

,INPUT-FORMAT = *FREE-RECORD-LENGTH / *BY-SDF-OPTION

,DATA-ESCAPE-CHAR = *NONE / ’&&’ / ’#’ / ’*’ / ’@’ / ’$’ / *STD

,SYSTEM-FILE-CONTEXT = *STD / *SAME-AS-CALLER / *OWN

,DATA-ERROR-HANDLING = *YES / *NO

,JV-REPLACEMENT = *NONE / *AFTER-BUILTIN-FUNCTION

,ERROR-MECHANISM = *SPIN-OFF-COMPATIBLE / *BY-RETURNCODE

,SUPPRESS-SDP-MSG = *NONE / list-poss(2000): <alphanum-name 7..7>

,TRANSLATION-CCS = *STD / *EDF03IRV / *CURRENT

Operands

CALLER =
Specifies which commands can be used to call the procedure.

CALLER = *ANY
The procedure can be called with CALL-PROCEDURE as well as with INCLUDE-PROCEDURE (ENTER-PROCEDURE issues a CALL-PROCEDURE command internally).

CALLER = *CALL
The procedure can be called only with CALL-PROCEDURE (or ENTER-PROCEDURE).

CALLER = *INCLUDE
The procedure can be called only with INCLUDE-PROCEDURE.

IMPLICIT-DECLARATION = *YES / *NO
Specifies whether implicit declaration of variables is allowed.

LOGGING-ALLOWED =
Specifies whether logging is allowed for the procedure and what can be logged.

LOGGING-ALLOWED = *PARAMETERS(...)
In the entries below, defines what can be logged.

CMD = *YES / *NO
Specifies whether commands can be logged.

DATA = *YES / *NO
Specifies whether data can be logged.

LOGGING-ALLOWED = *YES
Logging is allowed, i.e. both commands and data can be logged.

LOGGING-ALLOWED = *NO
Logging is not allowed.

INTERRUPT-ALLOWED = *YES
and resumed with the RESUME-PROCEDURE command.

INTERRUPT-ALLOWED = *NO
Specifies that the procedure cannot be interrupted with function key .

INPUT-FORMAT =
Designates the input format for procedure records.

INPUT-FORMAT = *FREE-RECORD-LENGTH
Records are interpreted in their full length. The records can contain only blanks between the continuation sign and the end of the record.

INPUT-FORMAT = *BY-SDF-OPTION
The input format of the procedure records is defined via the CONTINUATION operand in the MODIFY-SDF-OPTIONS command (see the “Commands” manual [3]).
The procedure record containing the SET-PROCEDURE-OPTIONS command is generally interpreted in its full length (it is equivalent to the entry FREE-RECORD-LENGTH).

DATA-ESCAPE-CHAR =
Sets the escape character. The escape character is the character which initiates expression replacement.

DATA-ESCAPE-CHAR = *NONE
Expression replacement is not to be carried out in data records.

DATA-ESCAPE-CHAR = / ’&&’ / ’#’ / ’*’ / ’@’ / ’$’
Defines an escape character.

DATA-ESCAPE-CHAR = *STD
The character & is used as the escape character.

SYSTEM-FILE-CONTEXT =
Determines the system file context in which the procedure is to run.

SYSTEM-FILE-CONTEXT = *STD
A separate system file context is set up. The system file SYSDTA is automatically assigned to the system file SYSCMD (i.e. to the procedure file). The caller’s assignments are used for all other system files. Any changes made to the assignments are valid only within the current procedure level. At the end of the procedure, the caller’s system file assignments apply again.

SYSTEM-FILE-CONTEXT = *SAME-AS-CALLER
The procedure is executed within the caller’s system file context. Any changes to the assignments within the current procedure level therefore always affect the caller’s system file context.

SYSTEM-FILE-CONTEXT = *OWN
A caller-specific system file context is set up. The caller’s assignments for all system files (including SYSDTA!) are used. Any changes made to the assignments are valid only within the current procedure level. At the end of the procedure, the caller’s system file assignments apply again.
The setting *OWN also corresponds to the previous behavior of non-S procedures.

DATA-ERROR-HANDLING =
Specifies that error handling is to be initiated in certain cases.

DATA-ERROR-HANDLING = *YES
Specifies that error handling is to be initiated in the following cases:

  • if a procedure line contains data where commands are expected

  • if expression replacement required in data lines cannot be executed

  • if a data record contains a single escape character.

DATA-ERROR-HANDLING = *NO
No error handling of the cases described above is initiated. &varname remains unchanged in the data if varname is not known as a function or a variable.

JV-REPLACEMENT =
Specifies whether job variable replacement is to be carried out during expression replacement.

JV-REPLACEMENT = *NONE
During expression replacement, names are not interpreted as job variable names.

JV-REPLACEMENT = *AFTER-BUILTIN-FUNCTION
In an expression in the form &(name), “name” is interpreted as a job variable name if there is no variable or built-in function with this name. This operand value is provided to permit behavior compatible with non-S procedures during expression replacement. Since the job variable name can be overwritten at any time by new variable declarations or built-in functions, we strongly recommend that this operand value should not be used; instead, job variable replacement should be executed by using the built-in function JV (i.e. by entering &(JV(’name’)).

ERROR-MECHANISM =
Specifies whether error handling is to be initiated in a manner compatible with the spin-off behavior of non-S procedures or whether “subcode1 not equal to zero” is to be taken into account. The operand setting has no influence on error handling for statements.

ERROR-MECHANISM = *SPIN-OFF-COMPATIBLE
Error handling is to be initiated in a manner compatible with the previous spin-off behavior. Subcode1 is not taken into account. This ensures that the behavior of S procedures created under BS2000 V10.0 remains compatible.

Note

ERROR-MECHANISM = *SPIN-OFF-COMPATIBLE does only affect the S procedure  in which it is declared. Error propagation into the calling procedure is solely governed by Subcode1. This especially means that the implicit exit from a *SPIN-OFF-COMPATIBLE S-procedure while spin-off is active and Subcode1 == 0 will be considered as non-error in the calling *SPIN-OFF-COMPATIBLE S-procedure or non-S procedure and the spin-off will become deactivated there.

ERROR-MECHANISM = *BY-RETURNCODE
Error handling is initiated if subcode1 of the last command return code is not equal to zero. The spin-off behavior is not taken into account. If *BY-RETURNCODE is specified, the error handling in S procedures must be matched to the command return codes of the various commands.

Note

In order to avoid problems which could result from the modification of the default value in the user syntax file, the selected value should be specified explicitly in the procedure.

SUPPRESS-SDP-MSG =
Specifies whether output is to be suppressed for specific SDF-P messages (message class SDP). The option is valid for the calling procedure only (i.e. it is not “inherited” by other procedures).

SUPPRESS-SDP-MSG = *NONE
No message output suppressed; all SDF-P messages are to be output.

SUPPRESS-SDP-MSG = list-poss(2000): <alphanum-name 7..7>
Set of SDF-P messages that are not to be output.

TRANSLATION-CCS =
Determines the coded-character-set used for translations to lowercase or uppercase performed by SDF-P built-in functions UPPER-CASE and LOWER-CASE.

If the current CCS is not supported or not known, or if the current CCS is not EDF03IRV and the XHCS subsystem is not started, the operation is rejected. The CCS must be a 8-bit code. 16-bit codes are not supported.

TRANSLATION-CCS = *STD
Use the basic EDF03IRV (compatible behavior) if no specific external settings changes this default behavior into *CURRENT. The external setting is an optional REP for SDF-P-BASYS. This REP is global to all tasks. 

TRANSLATION-CCS = *EDF03IRV
Force compatible value (use basic EDF03IRV).

TRANSLATION-CCS = *CURRENT
Use the CCS currently assigned to the input stream.

Note

When the built-in function processes string literals from a procedure, the input has already been translated in EBCDIC compatible format by the system. A coded-character-set specification (explicit name or implicit via *CURRENT) is only meaningful for extended EBCDIC character sets (e.g. EDF071 accented characters) or for values stored in variables which are coded in the specified character set (e.g. using the built-in function FROM-X-LITERAL).

Command return codes

SET-PROCEDURE-OPTIONS may be called only as the first command in the procedure head of an S procedure. SDF-P will detect any error in the procedure head during preanalysis and will subsequently abort the procedure call.

The following return codes can thus appear only if SET-PROCEDURE-OPTIONS is used outside the procedure head.

(SC2)

SC1

Maincode

Meaning


0CMD0001No error

1CMD0202Syntax error

1SDP0118Command in false context

3CMD2203Incorrect syntax file

32CMD0221System error (internal error)

130SDP0099No further address space available

Example

See the MODIFY-PROCEDURE-OPTIONS command, "MODIFY-PROCEDURE-OPTIONS Modify procedure attributes during procedure execution ".