Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

%CONTROLn

&pagelevel(3)&pagelevel

By means of the %CONTROLn command you may declare up to seven monitoring functions one after the other, which then go into effect simultaneously. The seven
commands are %CONTROL1 through %CONTROL7.

  • With criterion you may select different types of COBOL statements. If a statement of the selected type is waiting to be executed, AID interrupts the program and processes subcmd.

  • With control-area you may define the program area in which criterion is to be taken into consideration.

  • With subcmd you declare a command or a command sequence and possibly a condition (see AID Core Manual (Related publications) [1], "Subcommands"). subcmd is executed if criterion is satisfied and any specified condition has been met.

CommandOperand
%C[ONTROL]n[criterion][,...] [IN control-area] [<subcmd>]

Several %CONTROLn commands with different numbers do not affect one another. Therefore you may activate several commands with the same criterion for different areas, or with different criteria for the same area. If several %CONTROLn commands occur in one statement, the associated subcommands are executed successively, starting with %C1 and working through %C7.

The individual value of an operand for %CONTROLn is valid until overwritten by a new specification in a later %CONTROLn command with the same number, until the %CONTROLn command is deleted or until the end of the program.

A %REMOVE command can be used to delete either a specific or all active %CONTROLn declarations.

%CONTROLn can only be used in a loaded program, i.e. the base qualification E=VM must have been set via %BASE or must be specified explicitly.

%CONTROLn does not alter the program state.

criterion

is the keyword defining the type of the COBOL statements prior to whose execution AID is to process subcmd.
You can specify several keywords at the same time, which are then valid at the same time.

Any two keywords must be separated by a comma.
If no criterion is declared, AID works with the default value %STMT, unless a criterion declared in an earlier %CONTROLn command is still valid.

Wird kein kriterium vereinbart, arbeitet AID mit dem Standardwert %STMT, falls nicht noch aus einem vorhergehenden %CONTROLn eine kriterium-Vereinbarung gültig ist.

criterion

subcmd is processed prior to

%STMT

Every COBOL statement

%ASSGN

COBOL statements which modify the contents of a data item:

ADD [CORRESPONDING], COMPUTE, DIVIDE, INITIALIZE, INSPECT, MOVE [CORRESPONDING], MULTIPLY, SET, STRING, SUBTRACT [CORRESPONDING], UNSTRING

%CALL

CALL-, CANCEL-, INVOKE-, PERFORM statements as well as prior to SORT/MERGE statements, since these may call an INPUT or OUTPUT procedure.

%COND

EVALUATE, IF and SEARCH statements and the conditional THEN, ELSE and WHEN statement branches.

%DB

COBOL statements for calling a database: CONNECT, DISCONNECT, ERASE, FETCH, FIND, FINISH, FREE, GET, KEEP, MODIFY, READY, STORE

%EXCEPTION

The conditional statement branches and their admissible negations: AT END, AT END OF PAGE, INVALID KEY, ON SIZE ERROR, ON OVERFLOW, ON EXCEPTION, the RAISE statement as well as prior to the execution of a USE PROCEDURE.

%GOTO

ALTER, CONTINUE, GOTO, RESUME statements.

%IO

COBOL statements which initiate I/O operations: ACCEPT, DISPLAY, OPEN, CLOSE, DELETE, READ, REWRITE, START, WRITE, GENERATE, INITIATE, TERMINATE 

%LAB

COBOL statements which have a section or paragraph name or which directly follow such a name.

%PROC

Program or module start at the beginning of the PROCEDURE-DIVISION or at ENTRY. Program or module end by the statement STOP RUN, GOBACK, EXIT METHOD or EXIT PROGRAM

%SORT

MERGE and SORT statements, RELEASE and RETURN statements

Table 2: criterion declaration for the processing of subcmd

control-area

specifies the program area in which the monitoring function will be valid. If the user exits from the specified program, the monitoring function becomes inactive until another statement within the program area to be monitored is executed. The default value is the current program area.

control-area is limited to a compilation unit in programs without segmentation, and to a segment in programs with segmentation. The limitation to one segment applies only for independent segments (segment No.>50).

A control-area definition is valid until the next %CONTROLn command with the same number is issued with a new definition, until the corresponding %REMOVE %CONTROLn command is issued, or until the end of the program is reached. %CONTROLn without a control-area operand of its own results in a valid area definition being taken over. To be valid, such a control-area operand must be defined in a %CONTROLn command with the same number, and the current interrupt point must be within this area. If no valid area definition exists, the control-area comprises the current compilation unit or current segment by default.

control-area-OPERAND - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
IN [•][E=VM•] {   [S=srcname] [[•]PROC=program-id]
                | [PROC=program-id•] statementname
                | [S=srcname•]
                |  (source-referenz:source-referenz)
                | C=segmentname
                | C=sharename
              }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • If the period is in the leading position it denotes a prequalification, which must have been defined with a preceding %QUALIFY command. Consecutive qualifications
    must be separated by a period. In addition, there must be a period between the final qualification and the following operand part.

E=VM

As control-area can only be in the virtual memory of the loaded program, E=VM need only be specified if a dump file has been declared as the current base qualification (see %BASE command).

S=srcname

This is specified if control-area is not to be included in the current compilation unit or if a declared area restriction is no longer to apply.

PROC=program-id

This is specified if control-area is not contained in the current program, if it is to be defined with statementname and if this name is not unique in the compilation unit or in order to overwrite a previously valid control-area declaration. If control-area ends with a PROC qualification, the area covers the entire program specified. This must have been loaded at the time the %CONTROLn is entered or when the subcommand containing the %CONTROLn is processed.

If the srcname in the S qualification is identical to the program-id, instead of these two you need only write the PROG qualification.

Although you switch to machine code level with the following C qualifications, as the next step you can only select a criterion from the preceding table or AID will insert the default %STMT.

C=segmentname

This declares the designated segment for the control-area. It is only required if the interrupt point is not in this segment or if a previous area limitation applying to parts of this segment is to be removed.

C=sharename

This declares the designated object module for the control-area. It need only be specified if the interrupt point is not in the specified object module or if an area limitation applying to the object module is to be removed.

statement-name

The control-area is defined by a statement name and comprises a section or paragraph in the PROCEDURE DIVISION.

{ L'section' | L'paragraph' [IN L'section'] }

An alphanumeric section or paragraph name can be specified without L’...’ since this name cannot be confused with a data name in this command.

If a paragraph name is not unambiguous within a program, it must be identified by the section name of the section in which it was defined: L'paragraph' IN L'section'

(source-reference : source-reference)

The control-area is defined by specifying a start source reference and an end source reference. Both of these must be within the same compilation unit, where the following applies:
start source reference ≤ end source reference
If control-area is to comprise only one statement, the start and end source reference must be the same.
control-area cannot be limited to individual COBOL verbs within a line.

source-reference

designates the address of the first instruction generated for a statement in the PROCEDURE DIVISION and must be specified in one of the following formats:

S’n’

for lines with paragraph or section names in which no COBOL verb occurs. This specification is not possible for programs which have been compiled with STMT-REFERENCE=COLUMN1-TO-6.

S’nverb’ | S’xverb’

for lines containing a COBOL verb.

subcmd

subcmd is processed whenever a statement that satisfies the criterion is awaiting execution in the control-area. subcmd is processed before execution of the criterion statement.

If subcmd is not specified, AID inserts <%STOP> for %CONTROLn.

For a complete description of subcmd see the AID Core Manual (Related publications) [1].

subcmd-OPERAND  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 <[subcmdname:] [(condition):] [{AID-command|BS2000-command} {;...}]>e
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

A subcommand may contain a name, a condition and a command part. Every subcommand has its own execution counter. The command portion can consist of an individual command or a command sequence; it may contain AID commands, BS2000 commands and comments.

If the subcommand consists of a name or a condition, but the command part is missing, AID merely increments the execution counter when a statement of type criterion has been reached.

In addition to the commands which are not permitted in any subcommand, the subcmd of a %CONTROLn must not contain the AID commands %CONTROLn, %INSERT, %JUMP or %ON.

The commands in subcmd are executed consecutively, after which the program is continued. The commands for runtime control also immediately change the program state when they are part of a subcommand. They abort subcmd and start the program (%CONTINUE, %RESUME, %TRACE) or halt it (%STOP). In practice, they are only useful as the last command in subcmd, since any subsequent commands of the subcmd will not be executed. Likewise, deletion of the current subcommand via %REMOVE is only expedient as the last command in subcmd.

Examples

  1. %CONTROL1 %CALL, %PROCIN(S'123':S'250') <%DISPLAYCOUNTER;%STOP>
    %C1 %CALL,%PROC IN(S'123':S'250') <%D COUNTER;%STOP>
    The two AID commands differ only in their notation.
    The first example is written in full and contains a varying number of blanks at the permissible positions; the second example is abbreviated.
    The %CONTROL1 command is valid for the criteria %CALL and %PROC and is to be effective between statement lines 123 and 250 (inclusive). Statement line 123 contains no COBOL verb; statement line 250 contains the COBOL verb GO TO.
    If one of the COBOL statements corresponding to the criteria %CALL and %PROC occurs during program execution, the %DISPLAY command from subcmd is executed for the variable COUNTER. Then the program run is interrupted by means of %STOP, and AID or BS2000 commands may be entered.

  2. %CONTROL1 %CALL <%DISPLAY 'CALL' T=MAX; %STOP>
    Prior to the execution of every CALL or PERFORM statement, AID executes the %DISPLAY command from subcmd and then interrupts the program by executing the %STOP command.
  3. %CONTROL2 %SORT <%SDUMP %NEST P=MAX; %REMOVE C1>
    Prior to the execution of an SORT statement, AID outputs the current call hierarchy to the system file SYSLST and then executes the %REMOVE command, which deletes the declarations of %CONTROL1. Program execution continues.
  4. %C3 %PROC <%STOP>
    The %C3 command declares that AID is to execute a %STOP command before the first PROCEDURE DIVISION statement or the first statement following an ENTRY is executed or the module is quit or the program is terminated.
  5. %C4 %PROC <(SLF LE 10): %D TAB(1)>
    %C4 is used to declare that AID is to output the first table element with the name TAB prior to the first program or module start or program or module end provided that the SLF value is less than or equal to 10.