Space announcement This documentation space provides the same content as before, but the organization of the content has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

KEEP


COBOL

PL/I

Assembler

C Language

Description

The KEEP command continuously displays the value of program variables or selected data areas in a Keep window. The displayed values are updated as breakpoints are encountered and are denoted by a K in column 9 of the Keep window.

Code Debug TSO automatically keeps the values of data items referenced by the current execution line whenever execution halts. These values are either displayed at the bottom of the Keep window (default) or, optionally, in an Automatic Keep window at the bottom of the screen. See to SET for additional information.

The results of KEEP commands and automatic keeps are written to the session log unless they are suppressed by the SET LOG KEEP OFF and SET LOG AUTOKEEP OFF commands.

Input

image2021-2-16_10-17-30.png

KEEP Line Command Syntax

K    -  Keep the first variable on a line
Kn   -  Keep the nth variable on a line
K*   -  Keep all variables on a line
KK   -  Keep all variables on a block of lines
KE   -  Keep the elementary items for the variable on a line
KEn  -  Keep the elementary items for the nth variable on a line
E    -  Show the elementary items for a variable displayed in
        the Keep window
EE   -  Show the elementary items on a block of lines displayed
        in the Keep window
KH   -  Keep the variable on the line in hexadecimal format
KHn  -  Keep the nth variable on a line in hexadecimal format
H    -  Show the hexadecimal format of a variable displayed in
        the Keep window
HH   -  Show the hexadecimal format of the variables on a block of
        lines displayed in the Keep window

K line commands display the nth variable on a line as follows: K or K1 displays the first variable on the line, K2 displays the second variable, K3 the third variable, and so forth. Use K* when you want to display all the variables on the line. Kn and K* line commands treat a qualified data name as a unit.

Important

The K line commands cannot be used on lines of inserted code in Assembler, PL/I, or C.

The following are the parameter descriptions for the KEEP command:

KEEP

Displays data areas in EBCDIC format if defined as character (C); in decimal format if defined as decimal (P,Z,F,H); in hexadecimal format if defined as hexadecimal (X), binary (B), or address (Y,A,S,V,Q).

KeepE

Expands a group item or structure to its subordinate items and displays the value of each elementary item without showing the value of the group item or structure. The result is the same for a KEEPE command or a KEEP command when issued for an elementary item.


Important

The KEEPE primary command and equivalent line commands are not valid in Assembler.

KeepH

Displays the hexadecimal value of the specified data item in a Keep window. You can type over either the hexadecimal digits or the display digits. If you type over both fields, the hexadecimal digits take precedence.

You cannot type over the hexadecimal digits unless all lines (column template, EBCDIC display, and hexadecimal display) are shown on the screen. Typing over is not permitted if the display occurs at the bottom of the screen and vertical truncation occurs.

data

A data-name, variable, data-label, or register (Rn).

LINKAGE (COBOL only)

The linkage section of the active source program.

LOCAL-STORAGE (COBOL only)

The local-storage section of the active source program.

WORKING-STORAGE (COBOL only)

The working-storage section of the active source program.

CSR

The data area indicated by the cursor position.

Usage Notes

ALL Languages

  1. Usage notes related to tables and/or arrays can be located under the topics KEEP#Keeping Tables or KEEP#Keeping Arrays#Keeping Arrays. Related information is also located under the topics KEEP#Understanding the OCCURS Field and KEEP#Understanding the Index.
  2. E, EE, H, and HH should only be entered on a line in the Keep window. If entered on a source line, the result is a PEEK command.
  3. Kept items are updated at each interrupt until they are removed by the DELETE command. An interrupt occurs:
    • At an after, before, onetime, when, or trace breakpoint.
    • At a dynamic pause occurring when a GO or maximum count limit is reached. When a maximum count limit is reached in batch mode testing, the kept variables are updated in the session log. Execution resumes following the session log update as if the COUNT command had been reset.
    • At an abend.
  4. Kept items are displayed in the session log immediately after the breakpoint message and any error messages. If the value of the item changes, the new value is recorded in the session log along with a message to that effect. Any kept data names that have not changed value are also reported.
  5. Items are displayed in the order that they were kept; that is, the first item kept is displayed first, and so forth. Explicit keeps are always displayed before automatic keeps.
  6. The Keep window is both scrollable and adjustable in size. If the data exceeds the size of the window, move the cursor to the window and use the PF7 (UP) and PF8 (DOWN) keys to scroll the data vertically. Scroll the window horizontally by using the PF22 (DRIGHT) and PF23 (DLEFT) keys.

    Important

    The Keep window is cursor sensitive. To keep the cursor in the window while continuously scrolling up and down, put the cursor on the dashed line that separates the window from the source. You can do this either with the up and down arrow keys or with the Tab key.

    The SET WINDOW KEEP and SET WINDOW SOURCE commands also set the size of the Keep and Source windows. See to SET for information on sizing the Automatic Keep, Keep, and Source windows.

  7. When the cursor is in the Home position, use the LEFT (PF10) and RIGHT (PF11) commands to scroll the source, and the DLEFT (PF22) and DRIGHT (PF23) commands to scroll the data in the Keep window.
  8. Use the SHOW KEEPs command to show all items that have been kept.
  9. When testing interactively, kept lines are displayed immediately following the message area of the source display. The line command area for each kept data name can be typed over with any applicable line commands. The value field can be typed over in the same manner as with the PEEK command. A dashed line separates the fixed or kept area from the source area following it.
  10. A column template is displayed above the data areas that are defined as character (C). The column template corresponds to the length of the data area. Data areas defined as hexadecimal (X), address (A,Y,S,V,Q), binary (B), fixed-point (H,F), floating-point (E,D,L), or decimal (P,Z) are displayed without a column template. The length of a numeric field is a function of its internal representation.
  11. Nonrepresentable characters are displayed as periods (.) and invalid numeric values are displayed as question marks (?). Code Debug TSO displays lowercase data as is. If your terminal cannot display lowercase characters, you can have Code Debug TSO display lowercase characters as nonrepresentable characters by entering the following command:
      SET LOWCASE CONVERT
    To restore the default of displaying lowercase characters as is, enter the following command:
      SET LOWCASE ASIS

    Important

    A period (.) is the default for nonrepresentable characters. Use the SET NONDISP command to change the default. You cannot, however, change the default for invalid numeric values (?).

  12. The KEEP line commands automatically resolve data qualification. When using the KEEP primary command, you must specify the appropriate qualification. See to Command Qualification Rules.
  13. Type over the displayed data (implicit move) or use the MOVE command to reference any data area that is not in protected storage and alter its contents.
  14. The K line commands are taken as KEEP data area commands. The nth variable is determined as follows: K or K1 would keep the first data area on a line, K2 would keep the second data area, K3 the third data area, and so forth. K* is used when you want to display all the data areas on the line.

    Important

    The K line commands cannot be used on lines of inserted code in Assembler, PL/I, or C.

  15. Use the DELETE command or D line command to remove kept items from the Keep window.
  16. A different item list is maintained for each program. Each program’s kept items are displayed whenever that program is active. In this case, “active” means that a breakpoint occurred in that program, or a SOURCE command was issued for that module. Nested programs share a common keep list if they are part of the same module.

COBOL

PL/I

C Language

  1. A variable contains invalid data if it is an elementary numeric item and the contents of the variable do not conform to its defined usage.
    Code Debug TSO displays a numeric field containing invalid data as question marks (?). A flag indicating the invalid data type is displayed to the right of each numeric field.

PL/I

C Language

  1. Kept items that are defined as bit strings are kept in bit format, and a B is displayed on the right side of the Keep window. You cannot request a hexadecimal display on a bit string. Use the MEMORY command to see the hexadecimal values.
  2. Keeps on based variables will show the item and the address it is based on.

    Important

    K line commands can be entered on lines with no statement numbers.

  3. Using the primary KEEP command, based variables can be kept in the format:
      KEEP pointer -> variable

    The default base will be picked up if none is specified. To keep the variable G_REC based on the pointer ZPTR_3, enter the following:
      KEEP ZPTR_3 -> G_REC

  4. When addressability has not been established for a variable, the Keep window displays the message NO ADDR. The message disappears when addressability is established. This may happen for an automatic variable if the procedure it is declared in is not active; for a controlled variable if it has not been allocated; or for a based variable if the base has no addressability.
  5. KEEP does not support automatic adjustable arrays or structures with an unknown length at compile-time.
  6. Extended floating-point data (16 bytes) is formatted using just the first doubleword.

Assembler

  1. Data areas outside the program (reentrant), or data areas for which addressability has not been established, are not displayed.
  2. Data areas defined as graphic (G) are supported by the KEEP command.
  3. Data names longer than 32 bytes are fully scrollable in the Keep window, and the full data name can be displayed when the source is scrolled to the left.

Examples

COBOL

  1. To display the contents of EOF-SW at every pause breakpoint in the current module, enter:
       KEEP EOF-SW
  2. To keep SIDE-A of WORK-REC when duplicate variable names exist in the active program, qualify the variable as follows:
       KEEP SIDE-A OF WORK-REC

Assembler

  1. The following figure shows an example of keeping variables using the High-Level Assembler qualification syntax. These variables are made addressable by the labeled dependent USING instructions. See USING-command.
    Keeping Labeled Dependent USINGs 

    ---------------------------- CODE DEBUG TSO - SOURCE --------------------------
    COMMAND ===>                                                   SCROLL ===> CSR
    PROGRAM: HLAUS2     MODULE: HLAUS2    COMP DATE: 07/28/1995  COMP TIME: 11:50:00
                               OUTEMPA =000C94FF
                                                    ----+---
    000165 K  HIREDATE DS      CL8                >  09011994
                                INEMPA =000C94A8
                                                    ----+---
    000165 K  HIREDATE DS      CL8                >  09011972
    ------   ------------------------------------------ Before HLAUS2:124/AMODE 24 <>
    000110    LADUSING EQU     *
    000111             LA      R5,RECIN           ADDRESS OF EMPLOYEE RECORD READ
    000112             LA      R6,RECOUT          ADDRESS OF EMPLOYEE RECORD TO WRITE
    000113    INEMPA   USING   EMPLOYEE,R5        R5 IS INPUT BASE
    000114    INJOBA   USING   JOBINFO,OUTEMPA.EMPLOYEE+EMPLLEN
    000115    OUTEMPA  USING   EMPLOYEE,R6        R6 IS OUTPUT BASE
    000116    OUTJOBA  USING   JOBINFO,OUTEMPA.EMPLOYEE+EMPLLEN
    000117             MVC     OUTEMPA.FIRSTNAM,INEMPA.FIRSTNAM
    000118             MVC     OUTEMPA.LASTNAME,INEMPA.LASTNAME
    000119             MVC     OUTEMPA.BDATE,INEMPA.BDATE
    000120             MVC     OUTEMPA.HIREDATE,INEMPA.HIREDATE
    000121             MVC     OUTJOBA.JOBDESC,INJOBA.JOBDESC
    000122             MVC     OUTJOBA.JOBSTART,INJOBA.JOBSTARTs


COBOL

PL/I

Assembler

Understanding the OCCURS Field

When an element of a single-dimensional array (a table) or an element of a multi-dimensional array has been selected for a KEEP command, the display will also include an OCCURS field containing values representing the dimensions used to address the displayed element. An occurrence value may be associated with an underlying variable or it may just represent a fixed (disassociated) position of a specific table, array, or subordinate group.

An associated occurrence value for a displayed array element is one in which the occurrence value is dependant upon the related subscript or index variable that was specified in the PEEK or KEEP command. Thus, the occurrence value in the OCCURS field will be dynamically updated during program execution whenever the underlying variable changes.

disassociated occurrence value for a displayed array element is one in which the PEEK or KEEP command was entered using a numeric literal for the related subscript or index value. That specific occurrence value is not associated with a variable and must therefore be overtyped or otherwise modified to address a different element.

An occurrence value that contains an indicator prefix of either S= (subscripted) or I= (indexed) is associated with some underlying subscript or index variable. An occurrence value that is associated to a variable cannot have its value changed by being overtyped. Either the underlying variable must be changed, or the occurrence value must be manually disassociated from the variable by erasing the indicator S= or I= (and, optionally, changing the occurrence value).

One or more of the occurrence values can be disassociated from its underlying variable by blanking out the entire value (S=n or I=n) and replacing it with the numeric value representing the desired element position in the array. Once disassociated, an OCCURS position cannot be converted back. To reestablish the display of the desired element with associated occurrence values, use a new KEEP, PEEK, K, or P command, including variables for all of the subscript or index positions affected.

An OCCURS field containing multiple occurrence values may contain a mix of associated and disassociated occurrence values.

For example, if the current OCCURS field of a 4-dimensional array is

   S=2,S=4,S=1,S=3    OCCURS

and you replace the S=4 with a 1 and the S=3 with a 2, then press Enter, the OCCURS field will be changed to

   S=2,1,S=1,2    OCCURS

The first and third occurrence values are still associated with their underlying variables. The second and fourth occurrence values, however, are now disassociated from their underlying variables.

If an element group of a table or array is selected with the KEEP or PEEK command without specifying any occurrence values, the first element in that group is displayed using disassociated occurrences. All (meaning one or more) of the occurrence values are set to a default value of one. Each element of the group can then be referenced individually by overtyping any or all of the appropriate occurrence values.

Disassociated occurrence values can be altered or modified in a variety of ways to manipulate how array elements are displayed. Select a specific array element by overtyping the occurrence values to match the desired dimensions. Also, to browse an array element forward or backward, include a plus (+) or minus (-) modifier with the occurrence value. Then each time you press Enter, a new element will be displayed based on the value and modifier used.

COBOL

PL/I

Assembler

Keeping Tables

Important

Before reading this section, familiarize yourself with KEEP#Understanding the OCCURS Field.

The Code Debug TSO KEEP command can be used to display the contents of COBOL tables. The Code Debug TSO Keep window will display any occurrence of a group or elementary item at any level of the table.

  1. To concurrently display two occurrences of a table element in the Keep window, first duplicate the kept item by entering a K line command on the kept item. Then, if necessary, disassociate all of the occurrence fields that you plan to modify. Finally, overtype the disassociated occurrence fields with valid subscript or index values to display the desired occurrence of the element.

    Optionally, even more occurrences of the same item can be concurrently displayed using the same procedure. Each occurrence of the kept item can be independently incremented or decremented to keep some preceding or following occurrence in the Keep window.

    If a request is entered to keep an indexed or subscripted data name and the occurrence number is not specified, the first occurrence of that item is kept.

    When any table sub-element is kept, Code Debug TSO inserts an occurrence field above the element as shown in the following figure.

    A disassociated occurrence field can be overtyped with a valid subscripts to specify the next occurrence to be displayed.
    Example of Keeping a Table Sub-element 

    ------------------------------ CODE DEBUG TSO - SOURCE ---------------------------
    COMMAND ===>                                                    SCROLL===> PAGE
    PROGRAM:  TRIMAIN   MODULE: TRIMAIN   COMP DATE: 07/31/1995  COMP TIME: 14:41:59
                                             > 1                            OCCURS
                                               ----+----1----+----2-
    000026 K 10 N_NAME                        > EQUILATERAL TRIANGLES
                                             > 4                            OCCURS
    000027 K 10 N_CNTR                        > 0003                        DECIMAL
    ------   ------------------------------------------ Before TRIMAIN:45/AMODE 24 <>
    000023    01  N-N-C-TABLE            REDEFINES  NAME_N_CNTR-TABLE.
    000024        05  N-N-C              OCCURS 4 TIMES
    000025                               INDEXED BY TX.
    000026            10  N_NAME         PIC X(21).
    000027            10  N_CNTR         PIC 9(04).
    000028    01  OUT-OF-RECS            PIC X.
    000029    01  TRIANGLE_TYPE          PIC 9.
    000030    01  WORK-REC.
    000031        05  SIDE-A             PIC 9(01).
    000032        05  SIDE-B             PIC 9(01).
    000033        05  SIDE-C             PIC 9(01).
    000034 B  PROCEDURE DIVISION.
    000035    MAIN-PARA.
    000036        PERFORM INIT-PARA.
    000037        PERFORM ANALYZE-NEXT-REC

  2. When a table is updated interactively either by overtyping a disassociated occurrence field or by moving a new value to the associated variable, the session log is updated to show both of the new values for the variable and the table element along with all other kept items. For this to occur, however, KEEP data logging must be enabled. The logging occurs when Enter is pressed.
  3. When testing interactively, Code Debug TSO can be set to continuously display the next occurrence of a table element each time you press Enter. Appending a signed integer (-1 or +1, for example) to any disassociated occurrence level number will cause Code Debug TSO to increment or decrement the subscript by the specified amount.
    For example, if the current occurrence number is
    > 3,4,5      OCCURS
    and you append +1
    > 3,4,5+1    OCCURS
    Code Debug TSO will display occurrence 3,4,6. The occurrence field will now display
    > 3,4,6+1    OCCURS

    When you press Enter again, occurrence 3,4,7+1 will be displayed and so on. When the maximum occurrence for that level is reached, the subscript returns to the first occurrence. Code Debug TSO automatically increments to the next higher level subscript.

    This technique can be applied at any level and at more than one level at a time. This means
    > 3-1,4,6+1    OCCURS

    and other combinations of this type are permitted.
  4. Table items can be kept in a variety of ways. If no subscript is specified, the first item in the table is kept. If a numeric subscript is specified when the KEEP command is entered as a primary command, the kept item will show the field subscripted by that number.

    The table can also be kept with a data name as the index value. Whenever the Keep window is updated, the value of the data name is computed and the corresponding entry in the table is displayed. In this case, the occurrence field cannot be typed over. To see another value, do an explicit MOVE command to move a new index value to the data name.

    If a table element is kept with its index or subscript name, the display of the value in the session log also reports the value of the index or subscript.
  5. Code Debug TSO possesses another helpful feature. When you want to keep a data name that is indexed, you can name the index in the command, as follows:
      KEEP data-name (index-name)

    Then Code Debug TSO displays the value in the occurrence field. When the value of the index changes, the Keep window reflects the current value and displays the contents of the current table entry.

    To manually change an index value, blank out the applicable I= indicator and overtype that occurrence field with a new value. This disassociates the element display from the variable that I= represented.
  6. KEEP line commands (K, K*, etc.) set at an indexed data-name, referenced by a statement, pick up the current occurrence and issue a KEEP data-name (index-name) internally. For example, entering the K line commands: 

      k 0052            SET TX TO TRIANGLE_TYPE
      k 0053            ADD 1 TO N_CNTR(TX). 

    results in the following Keep window display:

    COBOL  K    TX                              >  3                          INDEX
                                                  I=3                       OCCURS
    000027 K 10 N_CNTR                          >  0000                     DECIMAL
            ** END **
    ------   ---------------------------------------- Before TRIMAIN:45/AMODE 24 <>

    Entering GO shows the value of the current occurrence using TX as the index. 

     
    COBOL  K    TX                              >  3                          INDEX
                                                  I=3                       OCCURS
    000027 K 10 N_CNTR                          >  0001                     DECIMAL
            ** END **
    ------   ---------------------------------------- Before TRIMAIN:45/AMODE 24 <>

    Typing over the occurrence field I=3 with 3 (blanking out the I=3) and pressing Enter disassociates the index TX from the display of the data name N_CNTR. 

     
    COBOL  K    TX                              >  3                          INDEX
                                                  3                         OCCURS
    000027 K 10 N_CNTR                          >  0001                     DECIMAL
            ** END **
    ------   ---------------------------------------- Before TRIMAIN:45/AMODE 24 <>


    When the index is disassociated from the data name, the index will not change even if the table index (TX) changes. 

     
    COBOL  K    TX                              >  4                          INDEX
                                                  3                         OCCURS
    000027 K 10 N_CNTR                          >  0001                     DECIMAL
            ** END **
    ------   ---------------------------------------- Before TRIMAIN:54/AMODE 24 <>

Example

Assembler

  1. The following figure shows an example of displaying a table in the Keep window. A disassociated OCCURS field is also displayed. A specific occurrence can be selected by overtyping the occurrence field. Element selections can also be incremented or decremented. This is done by appending a signed integer (for example +1, +3, or -2) to the occurrence field and repeatedly pressing Enter.
    Displaying a Table in the Keep Window 

    --------------------------- CODE DEBUG TSO - SOURCE ---------------------------
    COMMAND ===>                                                   SCROLL ===> CSR
    PROGRAM:  ALPRG4    MODULE: ALPRG4    COMP DATE: 07/09/1995  COMP TIME: 14:41:00
                                                  3                          OCCURS
    000720 K  NMRTABL  DS    18F                 > ..**
                                                  8155
                                                  00CC
             ** END **
    ------   ---------------------------------------------- Before ALPRG4/AMODE 24 <>
    000264    CHKNUM   TRT   HOLD.NMRTABL        VALIDATE HOLD FIELD
    000265             BC    8,EDITNUM           IF OK, EDIT FIELD FOR OUTPUT
    000266    BADACCT  MVC   OEMSG,MSG5          NONNUMERIC CHARACTER
    000267             B     ERRAMV


COBOL

PL/I

Assembler

Keeping Arrays

Important

Before reading this section, familiarize yourself with KEEP#Understanding the OCCURS Field.

The Code Debug TSO KEEP command can be used to display the contents of PL/I arrays. The Code Debug TSO Keep window will display any occurrence of an element of the array at any dimension combination.

  1. To concurrently display two elements of an array in the Keep window, first duplicate the kept item by entering a K line command on the kept item. Then, if necessary, disassociate all of the occurrence fields that you plan to modify. Finally, overtype the disassociated occurrence fields with valid subscript values to display the desired occurrence of the element.
    If a request is entered to keep an array and the subscript number is not specified, the first element of that array is kept.
    When any array element is kept, Code Debug TSO inserts an occurrence field above the element as shown in the following figure.
    A disassociated occurrence field can be overtyped with a valid subscript to specify the next occurrence to be displayed. Notice that in the following figure, the Keep window has been expanded using the SET command, allowing all data values to be displayed.
    Example of Keeping an Array Element 

    ------------------------------ CODE DEBUG TSO - SOURCE -------------------------
    COMMAND ===>                                                    SCROLL===> PAGE
    PROGRAM: TRIMINP1    MODULE: TRIMAINP COMP DATE: 08/07/1995  COMP TIME: 12:06:23
                                                    4+3                       OCCURS
                                                    ----+----1----+----2-
    000006 K    TBL                                  INVALID TRIANGLES
                                                    ----+----1----+----2----+----3
    MORE-> K 01 NAMES_N_CNTRS                     >  EQUILATERAL TRIANGLES...ISOSCE
                                                    1                         OCCURS
                                                    ----+----1----+----2-
    000007 K 03 N_NAME                            >  EQUILATERAL TRIANGLES
                                                    1                         OCCURS
    000007 K 03 N_CNTR                            >  +0002                     PACKED
    ------   --------------------------------------------- After TRIMINP1/AMODE 31 <>
    000006         DCL TBL(4) STATIC CHAR(21)
    ------            INIT(’EQUILATERAL TRIANGLES’,’ISOSCELES TRIANGLES’,
    ------                  ’SCALENE TRIANGLES’,’INVALID TRIANGLES’);
    ------
    000007         DCL 1 NAMES_N_CNTRS,
    ------              2 N_N_C(4),
    ------               3 N_NAME        CHAR (21) ,
    ------               3 N_CNTR        FIXED(4);

  2. When an array is updated interactively either by overtyping a disassociated occurrence field or by moving a new value to the associated variable, the session log is updated to show both of the new values for the variable and the displayed array element along with all other kept items. For this to occur, however, KEEP data logging must be enabled. The logging occurs when Enter is pressed.
  3. When testing interactively, Code Debug TSO can be set to continuously display the next occurrence of an array element each time you press Enter. Appending a signed integer (-1 or +1, for example) to any disassociated occurrence level number will cause Code Debug TSO to increment or decrement the subscript by the specified amount.
    For example, if the current occurrence number is
    > 3,4,5    OCCURS
    and you append +1
    > 3,4,5+1    OCCURS
    Code Debug TSO will display occurrence 3,4,6. The occurrence field will now display
    > 3,4,6+1    OCCURS
    When you press Enter again, occurrence 3,4,7+1 will be displayed and so on. When the maximum occurrence for that dimension is reached, the subscript returns to the first occurrence. Code Debug TSO automatically increments to the next higher level subscript.
    This technique can be applied at any dimension and at more than one dimension at a time. This means
    > 3-1,4,6+1    OCCURS
    and other combinations of this type are permitted.
  4. Array items can be kept in a variety of ways. If a numeric subscript is specified when the KEEP command is entered as a primary command, the kept item will show the field subscripted by that number.
  5. Code Debug TSO possesses another helpful feature. When you want to keep a variable that is subscripted, you can name the subscript in the command, as follows:
      KEEP array-name (subscript-name)
    Then Code Debug TSO displays the value in the occurrence field. When the value of the subscript changes, the Keep window reflects the current value and displays the contents of the current array entry.
    To manually change a subscript value, blank out the applicable S= indicator and overtype that occurrence field with a new value. This disassociates the element display from the variable that S= represented.
  6. KEEP line commands (K, K*, etc.) set at a subscripted array referenced by a statement pick up the current occurrence and issue a KEEP array-name (subscript-name) internally. For example, entering the K line commands: 

      k 0030                TX = TRIANGLE_TYPE;
      k 0031                N_CNTR(TX) = N_CNTR(TX) + 1;

    results in the following Keep window display: 

     
    000007 K    TX                              >  +00003                  HALFWORD
                                                  S=3                       OCCURS
    000007 K 10 N_CNTR                          >  0000                       ZONED
            ** END **
    ------   --------------------------------------- Before TRIMINP1:25/AMODE 31 <>

    Entering GO shows the value of the current occurrence using TX as the subscript.

     
    000007 K    TX                              >  +00002                  HALFWORD
                                                  S=2                       OCCURS
    000007 K 10 N_CNTR                          >  0001                       ZONED
            ** END **
    ------   --------------------------------------- Before TRIMINP1:25/AMODE 31 <> 

    Typing over the occurrence field S=2 with 2 (blank out the S=2) and pressing Enter disassociates the subscript TX from the array N_CNTR. 

     
    000007 K    TX                              >  +00002                  HALFWORD
                                                  2                         OCCURS
    000007 K 10 N_CNTR                          >  0001                       ZONED
            ** END **
    ------   --------------------------------------- Before TRIMINP1:25/AMODE 31 <>

    When the subscript is disassociated from the array, the subscript will not change even if the array subscript (TX) changes. 

     
    000007 K    TX                              >  +00002                  HALFWORD
                                                  2                         OCCURS
    000007 K 10 N_CNTR                          >  0005                       ZONED
            ** END **
    ------   --------------------------------------- Before TRIMINP1:25/AMODE 31 <>


C Language

Understanding the Index

When an element of a single-dimensional array (a table) or an element of a multi-dimensional array has been selected for a KEEP command, the display may also include an INDEX, in brackets, [ ], associated with an underlying variable or expression, or it may represent a fixed position (disassociated) of a specific table, array, or subordinate group.

An associated index for a displayed array element is the variable or expression that was specified in the PEEK or KEEP command. Thus, the index will be calculated during program execution whenever the underlying variables change.

A disassociated index for a displayed array element is the numeric literal that was specified in the PEEK or KEEP command. This specific index is not associated with a variable or expression and must therefore be specified in a PEEK or KEEP command to address a different element.

A displayed array element may contain a mix of associated and disassociated indexes, as follows:

   array[x][y+1].element[4]

An index will appear in the KEEP window as it is specified on the PEEK or KEEP command.

If an element group of a table or array is selected with the PEEK or KEEP command without specifying any index, the first element in that group is displayed. All (meaning one or more) of the indexes are set to a default value of zero.

C Language

Keeping Arrays

Important

Before reading this section, familiarize yourself with KEEP#Understanding the Index above.

The Code Debug TSO KEEP command can be used to display the contents of arrays. The Code Debug TSO Keep window will display any occurrence of an element of the array at any dimension combination.

  1. When an array is updated interactively, either by specifying a disassociated index in the KEEP or PEEK command or by moving a new value to the associated variable, the log is updated to show both of the new values for the variable and the displayed array element along with all other kept items. For this to occur, however, KEEP data logging must be enabled. The logging occurs when Enter is pressed.
  2. Array items can be kept in a variety of ways. If a numeric index is specified when the KEEP command is entered as a primary command, the kept item will show the field indexed by that number.
  3. Code Debug TSO possesses another helpful feature. When you want to keep a variable that is indexed, you can name the index in the command, as follows:
    KEEP array_name [index_name]
  4. KEEP line commands (K, K*, etc.), set at an indexed array, referenced by a statement, pick up the current occurrence and issue a KEEP array_name (index_name) internally.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*