*PROC Define Procedure Parameters

*PROC Statement - General Remarks

If a *PROC statement is present (see below for syntax), the following additional functions are available:

1) When the procedure is called, CFS first analyses the PROC statement, and displays a mask with all defined parameters, together with their predefined values (keyword parameters). This mask is identical to that displayed when starting a BS2000 DO procedure in Enter mode (see page 11-).

This parameter mask can be suppressed by starting the procedure as follows: DO N,procedure,... . Here, N means No Prompt for Parameters.

2) If specified in the PROC statement (*PROC x,....), the logging scope can be determined for the procedure run, as in BS2000 DO procedures.

If a *PROC statement is not present in the procedure, then the following points should be noted by both the procedure author, and the user:

1) The procedure statements and data records will not be logged (*PROC N).

2) The mask for entering parameter values cannot be displayed. All variables that are to have a predefined value must either be specified in the DO command as positional or as keyword parameters, or should be requested from the user during the procedure by means of a *PROMPT statement.

3) With regard to assigning the procedure variables from parameters at procedure call time, the procedure author must take note of the following:

The first positional parameter specified when calling the procedure can only be assigned to the variable name &1. Likewise, the second as &2, and so on.

*PROC Statement Syntax (Format 1)

*PROC x, (par, [" text "] ... )

The *PROC statement syntax is identical to that used in BS2000 DO procedures. The only thing missing in the *PROC statement is the SUBDTA parameter. Any number of continuation lines are possible. A hyphen (-) may appear at any point in the statement as a continuation character. In contrast to BS2000 procedures, a continuation line begins with '*', and not with '/'. Remarks enclosed in quotes (".....") can appear anywhere in the line. These remarks have a special function in the parameter mask when calling the procedure (see below).

The PROC statement in Format 1 must be the first statement in the procedure.

The individual PROC statement elements are described below:

x A | C | D | N

Control the logging scope of the procedure.

A All procedure statements, as well as all data records passed to CFS, will be displayed on the screen.

C Only the procedure statements (* statements) will be displayed on the screen.

D Only the data records passed to CFS will be displayed on the screen.

N Neither procedure statements nor data records will be displayed on the screen (Default).

par &var | &var=value

Establish procedure parameters (positional or keyword parameters).

&var A positional parameter is established for the procedure. A positional parameter has no predefined value. The value specified by the user for &var when calling the procedure can be used within the procedure.

&var=value A keyword parameter is established for the procedure. A keyword parameter can contain a predefined value. This predefined value of a keyword parameter can be amended when calling the procedure, by specifying var=value.

value Predefined value for the keyword parameter. value can be specified with or without quotes. If it contains special characters such as blanks, then it must be enclosed in quotes.

"text" The text specified here will be displayed in the parameter mask as 'var text...'. var is the name of the variable, and text is a description of the variable, possibly together with permissable values. The total length of var and text is restricted to 30 bytes.

By default, each procedure parameter will have one line reserved for it in the mask. This means that parameter values may normally not exceed 40 bytes. By specifying #n (n < 4), one to three additional input fields, each 40 bytes long, may be reserved. #n must be specified after the first " or ": .

Example: If the PROC statement contains a line as follows: /&FILE=TEST,     ":#3Name of the file to be processed",

then this DO parameter will be displayed in the mask as follows:



Name of the file to be processed =TEST



:



:



:

":text" The text specified here will be displayed as 'text...' in the parameter mask when the DO procedure is called. The variable name will not be displayed. text is a description of the variable, possibly together with permissable values. The total length of text is restricted to 30 bytes.

If no descriptive text is specified for a parameter, the parameter will be displayed in the mask as 'var '.

*PROC Statement Syntax (Format 2)

*PROC x This format is only used for setting or amending the logging mode. A Format 2 *PROC statement may appear many times within the procedure, and does not have to be the first statement in the procedure. This is true even if the procedure begins with a Format 1 *PROC statement.

x A | C | D | N

Control the logging scope during the procedure.

A All procedure statements, as well as all data records passed to CFS will be displayed.

C Only the procedure statements (* statements) will be displayed.

D Only the data records passed to CFS will be displayed.

N Neither procedure statements nor data records will be displayed (Default).