Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Foreground non-S procedures

&pagelevel(3)&pagelevel

The following list applies to procedures which are called in the foreground, i.e. to procedures which are to run in interactive mode or are called by other procedures.

  1. Procedure head and end of procedure

    1. Generate SDF-P procedure head:
      Remove the BEGIN-PROCEDURE or PROCEDURE command.
      The procedure now has a procedure head implicitly. The default settings of the SET-PROCEDURE-OPTIONS command apply to the procedure attributes. Procedure parameters cannot be transferred.

    2. Terminate procedure correctly:
      Remove the END-PROCEDURE or ENDP command.
      Insert the EXIT-PROCEDURE command.

  2. If necessary: declare procedure parameters:

    Generate a DECLARE-PARAMETER block (or call the DECLARE-PARAMETER command).
    If procedure parameters are to be transferred to the S procedure, they must be declared in the procedure head.
    In doing this, each parameter should be declared separately by calling the DECLARE-PARAMETER command. These command calls must then be incorporated into a DECLARE-PARAMETER block which is initiated with the BEGIN-PARAMETER-DECLARATION command and terminated with the END-PARAMETER-
    DECLARATION command.

  3. Initialize procedure parameters:

    Provide a value for the INITIAL-VALUE operand in the DECLARE-PARAMETER command.
    If a procedure parameter is declared with the default value INITIAL-VALUE = *NONE, it must be assigned a value in the procedure call. Otherwise, an error message is output.
    If the procedure parameter is declared with INITIAL-VALUE = *PROMPT, the user is prompted for the value in the dialog, after the procedure call. If prompting is not possible, the procedure parameter is implicitly assigned an empty character string.If the procedure parameter is assigned a value with INITIAL-VALUE, it does not have to be assigned a value in or after the procedure call. The defined initial value (INITIAL-VALUE) is then used as the default.

  4. If necessary, set job variable replacement:

    Unless otherwise specified, there is no job variable replacement in S procedures. This is possible only if the JV-REPLACEMENTS operand is set to the value AFTER-BUILTIN-FUNCTION, using the SET-PROCEDURE-OPTIONS command (or if this is set later on in the MODIFY-PROCEDURE-OPTIONS command in the procedure body). However, we recommend that the default be left unchanged; instead, &(jobvar) should be replaced with &(JV(’jobvar’)).

  5. If necessary, set procedure attributes:

    Using the SET-PROCEDURE-OPTIONS command in the procedure head, define the procedure attributes which are to be different from the default settings. This applies, for example, to the escape character in data records or behavior when errors occur in data records. The escape character is defined with the DATA-ESCAPE-CHARACTER operand, while the behavior in the event of errors is defined with the DATA-ERROR-HANDLING operand.

  6. Convert procedure call:

    1. CALL command:
      Replace with CALL-PROCEDURE or INCLUDE-PROCEDURE. The ISP command CALL is compatible with SDF-P; internally, it is mapped to the extended CALL-PROCEDURE command. As a result, the default settings for the CALL-
      PROCEDURE command apply to procedure calls with CALL. Nevertheless, procedure calls with CALL should be replaced with CALL-PROCEDURE or INCLUDE-PROCEDURE.

    2. Adapt CALL-PROCEDURE command:
      The CALL-PROCEDURE command was enhanced for SDF-P. If this enhancement is not taken into account in the command call, the appropriate default settings are used. If other settings are to be used, the corresponding operands must be included in the command call.

    3. Convert procedure call with DO command to CALL-PROCEDURE or INCLUDE-PROCEDURE:
      Procedure calls with the DO command continue to be supported. However, since DO does not support true call nesting, procedures should be called only with the command CALL-PROCEDURE or INCLUDE-PROCEDURE.
      When converting the procedure call from DO to CALL- or INCLUDE-PROCEDURE, note that termination behavior is different.

  7. Create valid branch tags:

    1. Replace non-S tags (format: .tag) with S tags (tag:)
      SDF-P supports tags in non-S format only on the top block level, but not in nested blocks. Non-S tags can be addressed in branches only with the SKIP-COMMANDS command (SKIP, SKIPJV, SKIPUS) and in commands used for conditional job control (MODIFY-JV-CONDITIONALLY, WAIT-EVENT, ADD-CJC-ACTION, WAIT, ON).

    2. Replace SKIP-COMMANDS command (SKIP, SKIPJV, SKIPUS) with control flow commands.
      If unconditional branches must be carried out with SKIP-COMMANDS, SKIP-COMMANDS can be replaced with the GOTO command: branches with SKIP-COMMANDS can be carried out only on nesting level 0, i.e. not in command blocks. Branches within command blocks or to superordinate command blocks are carried out with GOTO.
      If conditional branches are carried out with SKIP-COMMANDS, SKIP-COMMANDS can be replaced with an IF block (possibly IF-BLOCK-ERROR block or IF-CMD-ERROR block as well).

  8. Insert error handling

    Replace SET-JOB-STEP commands (STEP) with IF-BLOCK-ERROR or IF-CMD-ERROR.
    In S procedures, error handling is carried out in error handling blocks which are initiated with the IF-BLOCK-ERROR or IF-CMD-ERROR command. These error handling blocks cannot be preceded by a SET-JOB-STEP or STEP command, since SET-JOB-STEP and STEP eliminate the error situation. In this case, IF-BLOCK-ERROR or IF-CMD-ERROR can no longer detect the original error situation.
    Note that IF-BLOCK-ERROR does not reset any switches!

  9. Delete equals sign as first character in command call

    In some commands, the command names can be followed by any character: If this first character after the command name is an equals sign, SDF-P interprets the command line as a value assignment for a variable whose variable name is the command name.

  10. Replace job switch with variables:

    The execution of S procedures should not be controlled via job switches. For the purpose of job control, SDF-P provides control flow commands which can be used to program branches and loops. Variables are used in requesting the appropriate conditions.

  11. If necessary: mark statements:

    Procedure lines which contain statements must begin with two slashes.