Previous Topic: &CONCAT

Next Topic: &DATECONV


&CONTROL

The &CONTROL verb sets NCL procedure control characteristics.

This verb has the following format:

&CONTROL [ ALIGNLc | ALIGNRc | NOALIGN ]
         [ CMD | NOCMD  ]
         [ CMDSEP | NOCMDSEP ]
         [ CONT | NOCONT ]
         [ DBCS | DBCSN | DBCSP | NODBCS ]
         [ DUPCHK | NODUPCHK ]
         [ ENDMSG | NOENDMSG  ]
         [ FINDRC | NOFINDRC ]
         [ FLDCTL | NOFLDCTL ]
         [ IFCASE | NOIFCASE ]
         [ INTEGER | REAL  ]
         [ INTLOG | NOINTLOG  ]
         [ KEYXTR | NOKEYXTR  ]
         [ LABEL | NOLABEL  ]
         [ LOOPCHK | NOLOOPCHK ]
         [ MDOCHK | NOMDOCHK ]
         [ PAKEYS | NOPAKEYS ]
         [ PANELID | NOPANELID ]
         [ PANELRC | NOPANELRC ]
         [ PFKMAP | NOPFKMAP ]
         [ PFKSTD | PFKALL | NOPFK ]
         [ RECCHK | NORECCHK ]
         [ RESCAN | RESCAN1 | NORESCAN ]
         [ RNGLIM | NORNGLIM ]
         [ SAVE | NOSAVE  ]
         [ SHAREW | NOSHAREW  ]
         [ SHRVARS | SHRVARS=* | ( [ *, ] pref,...,pref ) |
           NOSHRVARS | NOSHRVARS=* | ( [ *, ] pref,...,pref) ]
         [ SUB | NOSUB ]
         [ TRACE | NOTRACE | TRACELOG | TRACELAB | TRACEALL ]
         [ UCASE | NOUCASE ]
         [ USRCMD | NOUSRCMD ]
         [ VARSEG | NOVARSEG ]

Specifying &CONTROL with no operands returns all CONTROL variables to their default values (see note on SHAREW operand). The &CONTROL statement defines all processing options available for modifying NCL execution characteristics.

Each option available on the &CONTROL statement has two possible settings: ON or OFF. The &CONTROL options are represented by keywords, which typically have the following forms:

value or NOvalue

NOvalue represents the OFF setting for value.

Every option has a default setting which is in effect when a process is invoked. Procedures within the NCL process can execute &CONTROL statements anywhere in the logic to set or reset any of the &CONTROL options. The combination of &CONTROL option settings in force at any instant for a process are called the process's &CONTROL environment.

If &CONTROL SAVE is specified or defaulted, then whenever a procedure calls another procedure using the EXEC command, the current &CONTROL environment is remembered and restored when the called procedure ends and returns control. This prevents the calling procedure from being affected if any &CONTROL options are changed by the procedure it calls or by any lower-level procedures.

&CONTROL does not affect the logic of a procedure or have any direct effect on variables. The verb changes the execution characteristics of subsequent statements in the procedure.

&CONTROL statements are processed inline, so most operands that are coded on an &CONTROL statement is specified as variables. The value or the variable specified is substituted according to its value at the time the statement is executed.

By setting the value of a variable to the name of one of the &CONTROL operands you can dynamically generate &CONTROL environments.

The &CONTROL CONT and NOCONT operands cannot be the subject of dynamic substitution because they govern the processing of statement continuations and are processed only when a procedure is loaded for execution.

Operands:

ALIGNLc | ALIGNRc | NOALIGN
ALIGNLc

Specifies that substituted values are aligned on the left side of the variable being replaced. The length of the variable name is preserved, and, if necessary, the fill character c is used to pad the substituted value to the right. If the fill character c is omitted, a blank is assumed.

This option lets you align tabular output. The length of the variable name being replaced determines the point of alignment. Therefore, use variables with similar length names if alignment is required. If substitution data exceeds the length of the variable, alignment cannot be performed and the option is ignored. If the variable value is null at the time of substitution, padding occurs for the full length of the variable name.

ALIGNRc

Specifies that substituted values are aligned to the right-hand side of the variable being replaced. The length of the variable name is preserved, and, if necessary, the fill character c is used to pad the substituted value to the left. If the fill character c is omitted, a blank is assumed. If the variable value is null at the time of substitution, padding occurs over the full length of the variable name. This option lets you align numeric tables.

NOALIGN

Specifies that the process of variable substitution is performed for the entire length of the variable being substituted. If the substitution data is shorter than the variable being replaced, characters to the right of the variable are shifted to the left.

Default: NOALIGN

CMD | NOCMD
CMD

Specifies that all commands executed from within a procedure (with the exception of the PAGE, CLEAR, and K commands) are to be echoed to the user terminal and logged on the activity log.

NOCMD

Specifies that all commands, until the end of the procedure or until an &CONTROL CMD statement, are not to be echoed to the user terminal. Commands are still logged to the activity log. Alternatively, use the suppression character (-) on each command individually. The suppression character also suppresses logging the command to the activity log.

Default: CMD

CMDSEP | NOCMDSEP
CMDSEP

Scans command strings executed from NCL procedures for the command concatenation character (;) and splits the commands accordingly.

NOCMDSEP

Specifies no scanning for the command concatenation character (;) and treats a command string as one command, irrespective of any command concatenation characters within the text of the command. Use this option where the command being executed can contain a semi-colon within the text of the command itself (for example, NSBRO issuing a broadcast where the broadcast text may contain a semi-colon).

Default: CMDSEP

CONT | NOCONT
CONT

Concatenates procedure statements if the last character of a statement that is not blank is a plus sign (+). This option makes it possible for a single statement to exceed the length of a procedure record. CONT cannot be dynamically substituted because the CONT and NOCONT operands are resolved during the NCL procedure load process.

NOCONT

Specifies that statements are not concatenated and treats any trailing plus signs as part of the statement in which they occur. This option is necessary for procedures that use commands, such as EQUATE, where a trailing plus sign may imply a trailing blank.

The &CONTROL CONT and NOCONT operands cannot be the subject of dynamic substitution because they govern the processing of statement continuations and are processed only when a procedure is loaded for execution. For example, you cannot use the following construction:

&A = CONT
&CONTROL &A

All other &CONTROL options are dynamically substituted.

Default: CONT

DBCS | DBCSN | DBCSP | NODBCS

Specifies the presence or absence of Double Byte Character Set (DBCS) data. Manipulating DBCS strings requires special care to preserve its integrity. The NCL language provides extensive support for DBCS data manipulation. This support is available in product regions executing with the SYSPARMS DBCS operand set to YES, IBM, or FUJITSU.

A string of data can contain a mixture of single byte (SBCS) and double byte data. Typically, special characters known as shift characters delineate DBCS data. A shift out character is used to mark the start of DBCS data, and a shift in character marks the return to SBCS data.

DBCS

Specifies that NCL is to be sensitive to the presence of DBCS data. When this operand is in effect, NCL ensures that DBCS or mixed DBCS/SBCS strings are not corrupted during string manipulation.

The DBCS operand causes the counting of shift characters when NCL calculates offsets and lengths in mixed strings. This option is useful when preparing data for display on IBM terminals such as the 5550, where shift characters display as blank one-byte fields.

DBCS adds some processing overhead to NCL. Use it only when the presence of DBCS data is expected. This operand is ignored if your product region is running with the SYSPARMS DBCS operand set to NO.

DBCSN

Specifies that NCL is to be sensitive to the presence of DBCS data. When this operand is in effect, NCL ensures that DBCS or mixed DBCS/SBCS strings are not corrupted during string manipulation.

The DBCSN operand causes shift characters not to be counted when NCL calculates offsets and lengths in mixed strings. This option is useful when preparing data for display on Fujitsu or Hitachi terminals, where shift characters do not take a screen position.

DBCSN adds some processing overhead to NCL. Use it only when the presence of DBCS data is expected. This operand is ignored if your product region is running with the SYSPARMS DBCS operand set to NO.

DBCSP

Specifies that NCL is to be sensitive to the presence of DBCS data. When this operand is in effect, NCL ensures that DBCS or mixed DBCS/SBCS strings are not corrupted during string manipulation.

When calculating offsets and lengths in mixed strings, the DBCSP operand causes NCL to count or not count shift characters, depending on the processing environment of the NCL procedure. If the procedure is executing on behalf of a user logged on from a Hitachi 560/20 or Fujitsu DBCS terminal, shift characters are not included in offset and length calculations. If the NCL procedure is executing on behalf of a user logged on from an IBM DBCS terminal or a terminal that does not support DBCS data, the shift characters are included in offset and length calculations. If the NCL procedure is executing in a background region (for example, BSYS), shift characters are included in offset and length calculations if your product region is executing under an IBM operating system, but not if your product region is operating under a Fujitsu or Hitachi operating system.

DBCSP simplifies coding where you want to execute the NCL procedure on various operating systems or by various terminal types. The option adds some processing overhead to NCL. Use this operand only when the presence of DBCS data is expected. This operand is ignored if your product region is running with the SYSPARMS DBCS operand set to NO.

NODBCS

Specifies that NCL processing does not include any special consideration for DBCS data. If mixed DBCS/SBCS strings are present, NCL's string manipulation functions could corrupt the data.

DUPCHK | NODUPCHK
DUPCHK

Specifies that a check is made for duplicate labels whenever an &GOTO statement is executed. The occurrence of a duplicate label terminates the procedure.

NODUPCHK

Specifies that no check for duplicate labels is performed when an &GOTO statement is executed. Control resumes at the first occurrence of the specified label following the &GOTO statement. If not found before the end of the procedure, the search for the specified label continues from the top of the procedure. If the label is missing, an error occurs (unless NOLABEL is in effect). Specifying this option can speed up processing of large procedures. If duplicate labels exist, unpredictable results can occur.

NODUPCHK is typically specified only after a procedure has been thoroughly tested.

Default: DUPCHK

ENDMSG | NOENDMSG
ENDMSG

Specifies that a completion message N03906 is issued to signal the completion of a procedure.

NOENDMSG

Specifies the suppression of the N03906 completion message unless an error occurs while processing the procedure, or a FLUSH or END command terminates the procedure.

Default: ENDMSG

FINDRC | NOFINDRC
FINDRC

Specifies that an attempt to execute a nested procedure that does not exist in the procedure library returns a value of 100 in the &RETCODE system variable, rather than fail the requesting procedure. This option allows the requesting procedure to detect requests to nest to nonexistent procedures.

NOFINDRC

Specifies that an attempt to execute a nonexistent nested procedure fails the requesting procedure.

Default: NOFINDRC

FLDCTL | NOFLDCTL
FLDCTL

Specifies that &ZMODFLD processing is performed for panels displayed by the current procedure. See the &ZMODFLD variable for details of this facility. The FLDCTL control option is required before &ZMODFLD is made available.

NOFLDCTL

Specifies that &ZMODFLD processing is not performed for panels displayed by the current procedure.

Default: NOFLDCTL

IFCASE | NOIFCASE
IFCASE

Specifies that the operands on an &IF statement are converted to uppercase before comparison. The conversion occurs only for the purposes of comparison, and does not change the value of the operands. IFCASE has no effect if the SYSPARMS DBCS=YES option is in force.

If variable uppercase translation is performed automatically on assignment, the effect of the &CONTROL UCASE option can override the intended effect of IFCASE. See the UCASE operand description.

NOIFCASE

Specifies that the operands on an &IF statement are compared without case translation.

Default: IFCASE

INTEGER | REAL

Specifies the precision of arithmetic functions that are used.

INTEGER specifies integer arithmetic, where integer operands in an arithmetic expression yield only integer results.

If an arithmetic expression contains real numbers that contain a decimal point or decimal fraction, then the expression is evaluated as if &CONTROL REAL were in effect.

&CONTROL INTEGER also controls the manner in which variables are compared. If &CONTROL INTEGER is in effect, the &IF statement performs a numeric comparison of two variables if both contain integer numbers. Otherwise, it performs a string comparison.

If &CONTROL REAL is in effect, then &IF performs a numeric comparison if both variables contain integers, real numbers, or the results of real number arithmetic calculations. If a real number calculation is performed and &CONTROL REAL is not in effect when a comparison (&IF) is executed, then a variable containing the result of a real number calculation, or a real number, is not treated as an integer, and a string comparison occurs.

Default: INTEGER

Note: For more information about integer and real number arithmetic, see the Network Control Language Programming Guide.

INTLOG | NOINTLOG
INTLOG

Specifies that all commands issued by &INTCMD and all responses resulting from those commands are logged to the activity log (but not echoed to the user terminal). Because of the concealed way in which &INTCMD operates, you may want to log the activity for certain commands. Commands processed by &INTCMD and associated responses is identified on the activity log with *nclid* in the node name column.

NOINTLOG

Specifies that commands issued with &INTCMD, and any associated responses to those commands, are not logged to the activity log. If the NOINTLOG operand is specified, the lines on the log showing *nclid* in the node name column is suppressed. Using &INTCLEAR to discard outstanding responses associated with &INTCMD processing can disown messages and force them to be logged. In these cases, the NOINTLOG operand is ignored and the outstanding messages are logged. To avoid this, structure your procedure to process all outstanding messages.

Default: INTLOG

KEYXTR | NOKEYXTR
KEYXTR

Specifies that the key portion of the record is extracted from the body of the record when it is placed in the &FILEKEY system variable when processing a UDB which has a key that does not start in the first position of the record (non-RKP 0). A field separator is inserted to separate the data that existed on either side of the extracted key.

NOKEYXTR

Specifies that when processing a UDB that has a key that does not commence in the first position of the record (non-RKP 0), the key portion of the record is not extracted from the main body of the record when it is placed in the &FILEKEY system variable. This can help when processing UDBs using alternate indices, as the relative position of variables having data assigned into them does not change. It may therefore be possible to use common processing for both base and alternate index processing. In such a case, no field separator is inserted.

Default: KEYXTR

Note: For more information about using this facility, see the Network Control Language Programming Guide.

LABEL | NOLABEL
LABEL

Specifies that the label which is the subject of an &GOTO or &GOSUB must exist. If an &GOTO or &GOSUB is attempted to a label which has not been defined, the procedure terminates with an error.

NOLABEL

Specifies that an &GOTO or &GOSUB to an undefined label does not terminate the procedure but instead passes control to the statement following the &GOTO or &GOSUB. Using NOLABEL can significantly simplify procedure writing. It eliminates the use of multiple &IF statements to determine the course of action to be taken and permits immediate branching to the appropriate point. If the label to which the branch is attempted is not defined, the statement following the &GOTO or &GOSUB is executed. This can have major performance advantages over conventional methods.

Where possible, the &CONTROL NOLABEL technique should be used where a large number of branch conditions are possible, for example in a procedure that is written to process VTAM messages.

In this case, each message commences with a message number (in the format ISTnnnn) which is associated with the type of processing required for that message. The message number can therefore be used as the label to be the target of an &GOTO.

In the following example, the &INTREAD statement is being used to request that the next VTAM message be presented to the procedure following the issuing of the command via the &INTCMD statement:

&CONTROL NOLABEL NODUPCHK
&INTCMD D LU1 .READ
      &INTREAD ARGS      &GOTO .&1
      -* Unexpected messages will drop past the &GOTO
       &WRITE ALARM=YES DATA=UNEXPECTED VTAM MSG &1 &2 +
            &3 &4 &5 &6
      &GOTO .READ
      -* Processing for expected messages follows
.ISTnnnI
.ISTnnnI
 :
         perform processing
 : &GOTO .READ
      -* End of output message from VTAM comes here
.IST314I
&END

Default: LABEL

LOOPCHK | NOLOOPCHK

Determines whether an NCL procedure is terminated in error due to excessive looping.

LOOPCHK

Specifies that the procedure is flushed if the &LOOPCTL setting is exceeded.

NOLOOPCHK

Specifies that a procedure is not flushed.

Default: NOLOOPCHK

MDOCHK | NOMDOCHK

Determines whether an NCL procedure is terminated in error if it encounters a Mapping Services error.

MDOCHK

Specifies that the procedure is flushed if, on an &ASSIGN statement, the &ZMDORC is set to 8 or higher.

NOMDOCHK

Specifies that the user is responsible for handling all Mapping Services errors.

Default: NOMDOCHK

PAKEYS | NOPAKEYS
PAKEYS

Specifies that the procedure intends to process terminal PA keys. If the user presses a PA key, control is returned to the procedure following a full-screen panel display, and the &INKEY variable is set to the value of the PA key pressed, which may be PA1, PA2, or PA3. If IPANULL=YES is specified on the #OPT statement on the panel definition, all input screen variables are nulled and internal validation bypassed. If IPANULL=NO is specified, all input variables retain their contents unmodified, as at the time the panel was displayed. No data is entered when using PA keys, and any data entered into input fields is lost. If two windows are open and both are eligible to receive PA key notification, it is indeterminate which window will receive such notification. PAKEYS applies to full-screen processing only.

NOPAKEYS

Specifies that the procedure is not interested in processing PA keys from the terminal. Pressing a PA key simply results in the terminal keyboard being unlocked.

Default: NOPAKEYS

PANELID | NOPANELID
PANELID

Specifies that the name of the current panel is to be displayed in the upper left hand corner of the panel. The panel name is displayed only if the panel contains some data on the first line and no field characters in the first 12 positions of the first line. The panel name overwrites any data in these first 12 positions. PANELID applies to full-screen processing only.

NOPANELID

Specifies that the current panel name is not to be displayed in the first 12 positions of the first line of the panel. NOPANELID applies to full-screen processing only.

Default: NOPANELID

PANELRC | NOPANELRC
PANELRC

Specifies that a procedure using an &PANEL statement to display a full-screen panel is designed to accept return codes from Panel Services that indicate specific processing conditions. The return code are available in the &RETCODE system variable on return from the &PANEL statement.

When processing with PANELRC, it is possible for the procedure to obtain notification of special situations that can assist in performing more advanced processing. For example, when using PANELRC it is possible to obtain the name of a field that has failed internal validation and to provide appropriate help information, or to determine that a requested panel does not exist and to avoid termination of the procedure. PANELRC applies to full-screen processing only.

Note: For more information about the PANELRC operand, see the Network Control Language Programming Guide.

Possible return codes are:

  • 0—One or more fields on the panel have been entered or modified. All validation that was to be performed by Panel Services (for example, EDIT=NUM) has been completed without errors. Used in conjunction with return code 4 a procedure can determine if displayed data has been modified and therefore warrants validation and perhaps updating on a file. If an asynchronous panel operation was being performed, return code 0 means that the display will not be performed because input is available from the preceding display of the same panel. The procedure should process the input received before re-displaying the panel.
  • 4—No fields on the panel have been modified since it was last displayed. It is the responsibility of the panel designer to allow for the situation where a panel is redisplayed, perhaps to flag a field in error, and this return code is then used to determine if any fields have been modified. This return code applies only to the last iteration with the terminal operator. If an asynchronous panel operation was being performed, return code 4 means that the panel display will not occur because input is available from the earlier display of the panel.
  • 8—Panel Services field validation detected an error. The &SYSFLD variable contains the name of the input field in error and &SYSMSG contains the text of the error message that describes the error condition (for example, FIELD NOT NUMERIC). The procedure can take any appropriate action, including modifying the message text in &SYSMSG or displaying help information. If the panel has been designed to take advantage of #OPT statement ERRFLD processing facilities and the ERRFLD operand is specified as ERRFLD=&SYSFLD then a re-display of the panel will perform normal error processing and position the cursor to the field in error. This return code is ideal for escaping from a panel where one or more fields have been specified as REQUIRED=YES.
  • 12—For synchronous &PANEL statements, 12 indicates that the INWAIT timer period has expired. No operator input has been made. The &INKEY system variable will be set to null. For asynchronous operations, 12 indicates that the panel display request has been accepted and the panel has been scheduled for display. If the same panel was displayed earlier and is being refreshed or updated, this indicates that no input was received from the earlier display.
  • 16—The requested panel could not be found on the panels data set or a syntax error occurred preventing the panel display. The &SYSMSG system variable contains an explanation of the error.
NOPANELRC

Specifies that a procedure using an &PANEL statement to display a full-screen panel is not designed to accept return codes from Panel Services. Panel Services is to perform all processing. NOPANELRC applies to full-screen processing only.

When NOPANELRC is in effect the following actions corresponding to the return codes provided by PANELRC will occur:

  • Fields changed—Must be determined by procedure.
  • No fields changed—Must be determined by procedure.
  • Field in error—Internal validation errors are processed by Panel Services. Redisplay of panels for error messages is automatic.
  • INWAIT expired—Must be determined by procedure. &INKEY variable is set to null.
  • Invalid panel name—NCL procedure terminates with an appropriate error message.

Default: NOPANELRC

PFKMAP | NOPFKMAP
PFKEYMAP

Specifies that the &INKEY variable (which is set to the value of the key used to input from a full-screen panel, for example, F1, F13) are to be set to a value in the range F1 to F12 when input results from the use of F13 to F24. Keys F13 to F24 are be mapped as F1 to F12. This can simplify the processing performed within the procedure as it need not cater for keys F13 to F24.

NOPFKMAP

Specifies that mapping of function keys is not to be performed. Keys F13 to F24 are presented unchanged and the NCL procedure must cater for them.

Default: NOPFKMAP

PFKSTD | PFKALL | NOPFK
PFKSTD

Specifies that non-system function keys, plus F3/4 and F15/16, are to be passed to the procedure for processing. Function keys F2/14 and F9/21are still processed by the system as SPLIT and SWAP keys. PFKSTD applies to full-screen processing only.

PFKALL

Specifies that all function keys are to be passed to the procedure for processing. Unless appropriate support is included in the NCL procedure, this option nullifies the use of split-screen operation. PFKALL applies to full-screen processing only.

NOPFK

Specifies that only non-system function keys are to be passed to the procedure for processing, following input from a full-screen panel. &INKEY is set to the value of the key pressed. System function keys are: F3/4, F15/16, F2/14, and F9/21. The use of F3/4 or F15/16 terminates (flushes) the procedure if this option is in effect. NOPFK applies to full-screen processing only.

Default: NOPFK

RECCHK | NORECCHK
RECCHK

Specifies that NCL is to test for recursive processing when invoking new nesting levels. NCL prevents a procedure of the same name as that already in use at a higher level from being invoked, as it could result in a recursive processing loop.

NORECCHK

Specifies that NCL is not to check for potential recursive processing when invoking new NCL nesting levels. When this option is used it is the responsibility of the procedure to ensure that recursive processing is not possible. Failure to adhere to this requirement may adversely effect other parts of the system.

Default: RECCHK

RESCAN | RESCAN1 | NORESCAN
RESCAN

Specifies that if NCL encounters an ampersand (&) within the value of a variable during substitution, then it treats it as an embedded variable name and not as data. The embedded variable name is subject to iterative resubstitution to a maximum of 16 times. For example, in the construction:

&CONTROL NORESCAN
&A = &CONCAT & TIME (&A value is &TIME)
&WRITE DATA=&A

&A is displayed as having a value of the character string &TIME.

In the construction:

&CONTROL RESCAN
&A = &CONCAT & TIME (&A value is &TIME)
&WRITE DATA=&A

&A is displayed as having a value of the character string 12.00.00, assuming the time is midday.

&CONTROL RESCAN is useful for resolving the value of variables passed to a nested or started NCL procedure when the parameters passed contain the names of other variables.

RESCAN1

Specifies that if, during substitution, NCL encounters an ampersand (&) within the value of a variable, then it treats it as an embedded variable name, not as data. There is no iterative resubstitution.

NORESCAN

Specifies that if, during substitution, NCL encounters an ampersand (&) within the value of a variable, it is to be treated as data, not as an embedded variable that is to be resubstituted.

Default: NORESCAN

RNGLIM | NORNGLIM

Specifying RNGLIM sets a limit of 64 on the operational range of the &ASSIGN statement when creating or modifying groups of variables. This is used to prevent logic errors (causing excessive numbers of variables to be created) in procedures that use &ASSIGN. RNGLIM does not restrict the range of variables that is deleted by &ASSIGN.

If very large numbers of variables are to be processed in one &ASSIGN operation, then use NORNGLIM to remove the limit of 64. NORNGLIM specifies that no range restriction is imposed on the ability of the &ASSIGN statement to generate groups of variables.

Default: NORNGLIM

SAVE | NOSAVE
SAVE

Specifies that when a nested procedure is invoked the current &CONTROL values are to be saved and automatically restored on return from the nested level. This ensures that any changes made to &CONTROL options by the nested level do not impact the current level. Thus, changes made to &CONTROL in the lower level impact only that level and other levels that it may invoke, and the saved values are restored on return.

NOSAVE

Specifies that &CONTROL values are not to be saved prior to invoking a nested level. Thus, changes to &CONTROL that are made in lower nesting levels remain in effect on return to this level. If NOSAVE is specified, it is the procedure's responsibility to ensure that changes to &CONTROL do not affect subsequent processing.

Default: SAVE

SHAREW | NOSHAREW
SHAREW

Specifies that the issuing procedure is prepared to allow other NCL processes, executing in the same NCL region processing environment associated with the same window, to issue &PANEL statements to take over the window display area.

If a procedure executes a &CONTROL SHAREW statement, any other process may obtain control of the display area. No indication is provided if any other process does obtain control of the window display area.

For this reason, &CONTROL with no operands does not reset SHAREW.

&CONTROL SHAREW status becomes effective when the issuing process obtains the right to ownership of the window.

If INWAIT=0 is specified on the panel definition, control does not return to the issuing procedure until the panel has been displayed.

NOSHAREW

Specifies that the issuing procedure is not prepared to allow any other process in the same NCL region to obtain control of the window display area by issuing &PANEL statements. If the procedure that executes an &CONTROL NOSHAREW statement does not actually have control of the window, then the status has no effect until the process obtains control of the window.

NOSHAREW is used when executing a process that needs to guarantee that no other process overwrites its information display.

Default: SHAREW

SHRVARS | SHRVARS=* | (pref,…,pref) | (*,pref,…,pref) | NOSHRVARS | NOSHRVARS=* | (pref,…,pref) | (*,pref,…,pref)
SHRVARS

Specifies that all user variables that exist when another nested procedure is invoked are to be shared with the nested procedure. When the nested procedure ends, all variables, including any new ones created by the nested level, are returned to the higher level. Variables deleted by the nested procedure are not reinstated on return.

The sharing of variables offers great flexibility in the design of modular procedures, as no limits are placed on the amount of data passed between the levels. The SHRVARS option only affects the next immediate level. If it in turn invokes another procedure, variables are not shared unless explicitly requested by another SHRVARS statement at that level.

SHRVARS does not affect the use of variables as parameters on an EXEC command. However, care must be taken when sharing variables such as &1, &2, and so on, since parameter variables specified on EXEC cause creation of variables &1, &2, and so on for the new procedure, which override the &1 and &2 variables of the invoking procedure.

&RETURN may be used to return variables that supplement any variables implicitly shared between procedures as a result of SHRVARS operation. This is ideal for returning an error message from a nested procedure, for example in the &SYSMSG variable.

SHRVARS=* | (pref,…,pref) | (*,pref,…,pref)

Specifies that sharing of variables is allowed between procedures in the same NCL process, but specification of prefix allows sharing only of generic ranges of variables. For example:

&CONTROL SHRVARS=(AB,DE)

allows sharing of only those variables that have names beginning with &AB or &DE. Other variables used by the sharing procedures are private. A maximum of 16 prefixes is specified. If multiple SHRVARS (or NOSHRVARS) statements are processed in a procedure the most recent takes effect and overrides any earlier specification.

SHRVARS=* means that a procedure is to share all generic prefixes that it was passed when it was invoked with any procedure that it in turn invokes. This allows different procedure nesting levels to share the same range of variables without explicit knowledge of the generic prefixes.

SHRVARS=(*,pref,…,pref) indicates that in addition to sharing all generic prefixes that it was passed when invoked the procedure wishes to share the further prefixes defined by pref with any procedure that it in turn invokes.

The SHRVARS option allows sharing of variables between procedures within the same NCL process. It does not imply any sharing of variables between a process and any other process that it may invoke using a START command, since the START command invokes a new NCL process.

NOSHRVARS

Specifies that variable sharing is not to be performed. In this case, data is passed on the EXEC command and is presented to the nested procedure in the variables &1, &2, and so on.

NOSHRVARS=* | (pref,…,pref) | (*,pref,…,pref)

Specifies that variable sharing is to occur between the current procedure in an NCL process and any that it executes, except for the variables that have names starting with the nominated generic prefixes. For example, a procedure that issues the statement:

&CONTROL NOSHRVARS=(WK,TST)

shares all variables except those beginning with &WK and &TST. This option allows procedures to retain private groups of variables which are not shared by (or returned by) nested procedures. A maximum of 16 prefixes is defined. If multiple NOSHRVARS statements are processed within a procedure, the most recent takes effect.

NOSHRVARS=* means that a procedure wishes to operate with the same exception list with any procedure it invokes as it was passed when it was invoked. This allows nesting levels to share (or exclude) the same range of variables without explicit knowledge of the generic prefixes involved.

NOSHRVARS=(*,pref,…,pref) indicates that, in addition to the generic prefix exception list that it was passed when it was invoked, a procedure wishes not to share the additional generic prefixes as defined by pref.

Default: NOSHRVARS

SUB | NOSUB
SUB

Specifies that all procedure statements, with the exception of comment lines that start with the suppression character (-*), are to be scanned, and that variable substitution is to be performed.

NOSUB

Specifies that variable substitution is no longer to be performed. &IF statements, &GOTO statements, and commands are still to be executed, but without prior substitution of variables. Substitution resumes when the next &CONTROL SUB statement is encountered during processing. The substitution process scans all lines for variables that commence with an ampersand (&). Unrecognized variables, which do not currently have an assigned value, are regarded as nulls and are eliminated from the command string. Thus, if comments or commands are to contain words that include an ampersand, the NOSUB control variable must be used to stop the substitution process from eliminating the potential variable from the string.

Default: SUB

TRACE | NOTRACE | TRACELOG | TRACELAB | TRACEALL
TRACE

Specifies that statements are to be displayed after variable substitution and prior to execution. Message N03802 is issued with the number of the statement being executed and the substituted text of the statement. Tracing is used during the development of procedures to ensure their correct operation. If tracing is active when an &PANEL statement is issued, any panel control statements in the panel definition are traced after variable substitution has been completed. Statements are displayed at the operator's terminal only, and not written to the activity log. For example:

&CONTROL TRACE NOINTLOG ALIGNR

Tracing can generate a large amount of output and should be used at selective points within the procedure. The system limits the maximum number of trace messages that is generated by an NCL procedure. This limit is set by the SYSPARMS NCLTRMAX command and defaults to 100. When this limit is reached, tracing is automatically terminated. Trace messages are not sent to the system log unless the TRACELOG operand is used.

NOTRACE

Cancels a previous &CONTROL TRACE, TRACEALL, or TRACELOG statement.

TRACELOG

Specifies that tracing of NCL statements is written to the system log and that the statements are not displayed at the terminal of the operator.

TRACELAB

Specifies that only procedure labels are traced. TRACELAB requires either TRACE or TRACELOG to start tracing. NOTRACE resets the TRACELAB option. A label trace includes details of the statement number, procedure name, and the NCL ID for labels only. TRACELAB is used to provide a summary trace to analyze overall procedure flow, perhaps across multiple procedures.

TRACEALL

Specifies the provision of expanded trace information. Standard trace information is restricted, to limit the amount of data displayed. TRACEALL requests that, in addition to the standard information, the N03802 trace message is to include the name of the processing procedure and its NCL ID.

Default: NOTRACE

UCASE | NOUCASE
UCASE

Specifies that, during assignment processing, the lowercase characters 'a' to 'z' are converted to uppercase when they are placed in the receiving variable. The equals symbol (=) indicates an assignment statement and implies movement of data into the target variable to the left of the statement.

When operating in a system in which the SYSPARMS DBCS=YES option is set, the UCASE and NOUCASE operands are ignored.

NOUCASE

Specifies that, during assignment processing, data is not converted to uppercase.

Default: UCASE

USRCMD | NOUSRCMD

Affect REPL equates only.

USRCMD

Specifies that REPL equates replace commands issued within the procedure, if a matching REPL equate exists.

USRCMD specifies that EQUATE processing is enabled for commands strings within this procedure. If a string has a corresponding EQUATEd text value, that value is used as a replacement for the EQUATEd command string.

NOUSRCMD

Specifies that REPL equates do not replace commands issued within the procedure, even if a matching REPL equate exists.

NOUSRCMD specifies that EQUATE processing is disabled for command strings within this procedure, even if a corresponding EQUATE exists.

Default: NOUSRCMD

VARSEG | NOVARSEG
VARSEG

Specifies that multiword variables that are passed to a nested procedure or that are received using an &INTREAD are to be segmented into individual variables on entry to the nested level or on completion of the &INTREAD. Each word of a multiword variable is separated and placed in the next sequential variable (for example, &1, &2, …, and &n).

NOVARSEG

Specifies that multiword variables that are passed to a nested procedure or that are received using an &INTREAD are not to be segmented. Variables remain unchanged on entry to the nested procedure or on completion of the &INTREAD. An alternative to the passing of data on the EXEC command is to use the SHRVARS operand to share all variables between the two procedures.

If variables containing hexadecimal data contain embedded blanks (X'40'), the variables are segmented regardless of the VARSEG or NOVARSEG operand. To avoid segmentation, code the following statement:

&CONTROL NOVARSEG &A=&FILEKEY -EXEC PROCB &A

instead of:

&CONTROL NOVARSEG -EXEC PROCB &FILEKEY

Null characters (X'00') are converted to blanks (X'40') by this process.

Default: VARSEG

More information:

DBCS Support in NCL