Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@PARAMS - Define procedure parameters

&pagelevel(3)&pagelevel

The @PARAMS statement can be used to define symbolic parameters which are used in @DO procedures. There is a distinction between keyword parameters and positional parameters.

The parameters can be considered as string variables which are replaced, before the EDT procedure is executed, by the corresponding values which were specified when the procedure was called in the @DO statement or, in the case of keyword parameters, are defined as the default values in the @PARAMS statement itself.

Operation

Operands

@PROC

@PARAMS

[formal[,...] ] [ [,] {formal=param} [,...] ]

formal

Formal (symbolic) parameter. A parameter starts with the character &. This
is followed by a letter (A..Z, a..z) which in turn can be followed by up to
6 letters or digits. Lowercase characters may also be used. It should be
noted that EDT differentiates between uppercase and lowercase. The
specifications &A and &a therefore designate different parameters. The
parameter names used in a work file only apply within this work file. If an
illegal formal parameter is specified then execution of the procedure is
rejected with the message EDT4924.

param

Default value of the keyword parameter. The specified value is used in the
procedure if no other value was specified for this keyword parameter when
the procedure was called with the @DO statement. Keyword parameters
must be declared after all the positional parameters.

The @PARAMS statement must be located in the first line of a @DO procedure. A @PARAMS statement in continuation lines is ignored and the message EDT5479 is output. Errors in the @PARAMS statement interfere with the execution of the procedure and are reported by @DO. The @PARAMS statement is not itself a component of the procedure and can, for example, not be branched to, is not logged if the procedure is executed with the setting @DO...PRINT and is not executed more than once in procedures which contain external loops.

At least one formal parameter must be specified. Otherwise execution of the procedure is rejected with the message EDT4918. The same message is output if a parameter does not start with & or there is no further parameter after a comma.

If positional parameters are specified after keyword parameters then the message EDT4948 is issued. If a keyword parameter is specified more than once then the error message EDT3910 is output. In the event of other errors, the message EDT5478 is output.

The number of formal parameters possible in @PARAMS is only limited by the maximum permitted length of EDT statements.

In the @PARAMS statement, EDT ignores blanks which occur immediately before or after a parameter name. The specification of blanks in the parameter name which was possible in compatibility mode is no longer supported.

In keyword parameters, the parameter name (keyword) is followed by an equals sign. The equals sign is followed by the parameter's default value. Keyword parameters are also assigned the current value from the parameter list in the @DO call. If this value is not present there then the predefined default value specified in @PARAMS is used. The assigned default value consists of all the specified characters, including blanks. If no default value is to be assigned to a keyword parameter then a comma must be specified immediately after the equals sign or @PARAMS must be terminated. Alternatively, the explicit specification of an empty string '' as the default value is also possible.

The default value of a keyword parameter may be enclosed in single quotes. These are not transferred if they occur as the first or last character in the parameter value and no quotes or only double quotes occur between them. In all other cases, all the specified single quotes form part of the parameter (see example). The comma and closing parenthesis characters may only form part of a parameter if they occur in a substring in the parameter value that is enclosed by single quotes. Single quotes must always occur in pairs in a parameter value. An individual single quote cannot be passed in a parameter value. If @QUOTE has already been used to assign the function of the single quote to another character then this does not apply to the single quotes enclosing the default value.

If no value is specified for a positional parameter when the procedure is called with @DO then it is assigned an empty string as its value. If no value is specified for a keyword parameter when the procedure is called with @DO then it is assigned the default value specified in the @PARAMS statement as its value.

The positional parameters must be specified in the same order in @PARAMS and in @DO. The sequence of keyword parameters can be different in @PARAMS and @DO (see the @DO statement).

If the procedure file contains a string which starts with & and could syntactically be identified as a formal parameter which, however, is not declared in the @PARAMS statement or if there is no @PARAMS statement then the corresponding string is not replaced.

The parameters can be used at any location within the procedure and can be linked together with other strings and parameters.

If, in the procedure, the formal parameter is directly followed by a letter, a digit, or a period then the formal parameter must be separated from these characters by a period (except in the case of parameter names with a maximum length of 7).

A single period after a formal parameter is interpreted as a delimiter and is not taken over when the formal parameter is replaced by the corresponding value (see example). This applies independently of the character that follows the period.

If a string which starts with & and corresponds to one of the formal parameters listed in @PARAMS is not to be replaced by the current parameter value in the procedure file then the & character must be doubled. When the procedure executes, one of the two &s is eliminated. Any other doubled &s are reduced to a single & if the procedure contains a @PARAMS statement.

If a formal parameter is replaced by the current parameter value in the procedure then this may cause the line to exceed the maximum permitted line length. This causes the output of error message EDT1938 during the execution of the procedure. The line in question is not executed.

For information on the handling of character sets during parameter processing, see section “EDT procedures” and the description of the @DO statement.

The indirect specification of operands is not permitted for this statement.

Example 1

Parameter value specification

Substituted string

&F=A,...

&F=,...

&F='',...

&F='BLANK'ABC'BLANK',...

&F='X',...

&F='X''X',...

&F='X'Y'X',...

&F='AB'C,...

&F='BLANK''ABC',...

&F='BLANK',...

&F=',)',...

&F=A','B,...

A

Empty string

Empty string

'BLANK'ABC'BLANK'

X

X''X

'X'Y'X'

'AB'C

'BLANK''ABC'

'BLANK'

,)

A','B

Example 2

Line in procedure file

Parameter input

Generated line

&PARAM(BC)

&PARAM.(BC)

&PARAM..(BC)

&PARAM..BC

&PARAM.2BC

&PARAMBC

&PARAM,.2B

BC&PARAM

BC,&PARAM

B2&PARAM

&PARAM.&PARAM

&PARAM&PARAM

&PARAM..&PARAM

&PARAM&&PARAM

@ON &F'&SEARCH'

@SET #S1=&STR

&DATA

@P RANGE

&CMD #S1

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&PARAM=A

&SEARCH=A''B

&STR='BLANK''TEXT'

&DATA='A'B

&RANGE='3,7'

&CMD=@PRINT

A(BC)

A(BC)

A.(BC)

A.BC

A2BC

&PARAMBC

A,.2B

BCA

BC,A

B2A

AA

AA

A.A

A&PARAM

@ON &F'A''B'

@SET #S1='BLANK''TEXT'

'A'B

@P 3,7

@PRINT #S1

Example 3

   7.     @PRINT
   1.0000 THE OUTPUT
   2.0000 FROM THIS
   3.0000 PROCEDURE
   4.0000 IS DETERMINED
   5.0000 IN THE @DO
   6.0000 COMMAND
   7.     @SET #S3 = '*** AS YOU SEE ***'
   7.     @PROC 1
   1.     @ @PARAMS &LINES --------------------------------------------- (1)
   2.     @ @NOTE Output &LINES
   3.     @ @PRINT &LINES ---------------------------------------------- (2)
   4.     @END
   7.     @DO 1(2-4) --------------------------------------------------- (3)
   2.0000 FROM THIS
   3.0000 PROCEDURE
   4.0000 IS DETERMINED
   7.     @DO 1(#S3),PRINT
   7.     @NOTE Output #S3 --------------------------------------------- (4)
   7.     @PRINT #S3
     #S03 *** AS YOU SEE ***
   7.     @DO 1(2,4N) -------------------------------------------------- (5)
 %  EDT4963 TOO MANY OPERANDS
   7.     @DO 1('2,4N') ------------------------------------------------ (6)
   2.0000 FROM THIS
IS DETERMINED
   7.
(1)The positional parameter &LINES is declared in the first line of work file 1.
(2)

This parameter occurs in the @PRINT statement. Which lines are now output depends on the parameter value specified in the @DO statement.

(3)

Work file 1 is executed. However, before the individual statements are executed, the range of values 2-4 is assigned to the parameter &LINES.

(4)

The use of the parameter values becomes particularly clear if the individual statements in the procedure are output on the screen before they are executed since the parameter values have already been inserted at this point.

(5)

If the user attempts, for example, to display line 2 with a line number and line 4 without a line number then a comma which forms part of the parameter value is interpreted as a separator between two parameters and the @DO statement is therefore rejected.

(6)

A parameter value can be passed in single quotes. In this case, the value that is located between the single quotes is assigned to the &LINES parameter. In this way, it is also possible to transfer commas as a part of the parameter value.


Example 4

   1.     @PROC 2
   1.     @ @PARAMS &STRVAR1,&STRVAR2,&CONTENT1=**** -------------------- (1)
   2.     @ @SET &STRVAR1 = '&CONTENT1'
   3.     @ @SET #S2 = '&STRVAR1'
   4.     @ @SET #S3 = &STRVAR1
   5.     @ @SET &STRVAR2 = &STRVAR1
   6.     @ @SET #S4 = 'FROM &STRVAR1 TO &STRVAR2'
   7.     @ @PRINT &STRVAR1,&STRVAR2,#S2,#S3,#S4
   8.     @END
   1.     @DO 2(#S0,#S1) ------------------------------------------------ (2)
     #S00 ****
     #S01 ****
     #S02 #S0
     #S03 ****
     #S04 FROM #S0 TO #S1
   1.     @DO 2(#S15,#S13,CONTENT1=BLABLA) ------------------------------ (3)
     #S15 BLABLA
     #S13 BLABLA
     #S02 #S15
     #S03 BLABLA
     #S04 FROM #S15 TO #S13
1.
(1)Two positional parameters and one keyword parameters are defined for work file 2.
(2)

The values of the positional parameters in @DO must be specified in a sequence which corresponds to the sequence of the positional parameters in the @PARAMS line. When work file 2 is executed, the value of &STRVAR1 is set to #S0 and the value of &STRVAR2 is set to #S1. Since no value is specified for the keyword parameter &CONTENT1, the default value, i.e. ****, is used at runtime.

(3)

The specification of a parameter value for a keyword parameter in @DO replaces the default value.


Example 5

1.     @PROC 3
1.     @ @PARAMS &A,&B,&C,&X=111,&Y=222,&Z=333 ----------------------- (1)
2.     @ @CREATE #S10: '&A','&B','&C','&X','&Y','&Z'
3.     @ @PRINT #S10
4.     @END
1.     @DO 3 (AAAAA,BB,CCCCCCC) -------------------------------------- (2)
  #S10 AAAAABBCCCCCCC111222333
1.     @DO 3 (AA,BBBB,C,Y=****,X=########) --------------------------- (3)
  #S10 AABBBBC########****333
1.
(1)Three positional and three keyword parameters are defined in work file 3.
(2)

Work file 3 is executed. However, since no values have been specified for keyword parameters, the default values are used.

(3)

Now, values are specified for two of the keyword parameters. It should be noted that the sequence of values specified for the keyword parameters does not correspond to the sequence used for the definition of the keyword parameters in the @PARAMS line.