With %SDUMP you can output a symbolic dump: individual data items or file definitions, all data items or file definitions of the current call hierarchy, or the program names of the current call hierarchy. The current call hierarchy extends from the subprogram level on which the program was interrupted to the sequence of CALL statements to the outermost program. Output is via SYSOUT, SYSLST or to a cataloged file.
With dump-area you designate the data items or file definitions which AID is to output, or you specify that AID is to output the program names of the current call hierarchy.
With medium-a-quantity you specify which output media AID is to use, and whether or not additional information is to be output. This operand is used to deactivate a declaration made by the %OUT command, as far as the current %SDUMP command is concerned.
- With the %INDPOS keyword you specify to place the corresponding indexes after each element of the Cobol array. The %INDPOS keyword applies to the entire %SDUMP command, must be specified once, and is effective for all output media in the %SDUMP command. The %INDPOS keyword is applied after [dump-area][,...] and before [medium-a-quantity].
Command | Operand |
%SD[UMP] | [[dump-area][,...] %INDPOS [medium-a-quantity][,...]] |
If compilation units for which there are no LSD records, not even in a PLAM library, are included in the hierarchy, the user must individually specify the compilation units for which LSD records have been loaded or for which they can be loaded from a PLAM library (see %SYMLIB command). dump-area can be repeated up to 7 times.
%SDUMP without operands outputs all data items of the current call hierarchy, if AID is able to access the associated LSD records. Data that is defined more than once is also output more than once.
%SDUMP %NEST outputs the names of all program of the current call hierarchy.
Input of the command immediately following loading is not recommended as not all entries in the DATA DIVISION will have been initialized (e.g. record definitions and special registers) and an error message may occur.
If you enter a name for dump-area which is not contained in the LSD records, AID issues an error message. The other dump-areas of the same command will be processed normally.
With this command the user can work either in the loaded program or in a dump file.
The %SDUMP command does not alter the program state.
dump-area |
describes which information AID is to output.
AID can output the program names of the current call hierarchy, all data of the current call hierarchy, all data of a program or individual data items or file definitions. AID edits the data items in accordance with the definition in the source program. If the contents do not match the defined storage type, output is rejected and an error message is issued.
If dataname or filename is defined in multiple DATA DIVISIONs of the current call hierarchy it is also output repeatedly, unless dump-area has been restricted by a qualification or dataname is identified. If a data item or DATA DIVISION that is to be output contains redefinitions, these are also output.
All data items generated by the compiler are contained in an %SDUMP with which entire DATA DIVISIONs are output. The output also includes information on the files defined in the program, e.g. file status, contents of the I/O areas and the record definitions.
dump-area-OPERAND - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[•][qua[•]][ { filename | dataname | %NEST } ]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
•
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.
qua
Specify one or more qualifications if the interrupt point is not within the scope of the addressed object or if the memory object is not visible at the interrupt point. Only enter the qualification required for unique addressing.
E ={VM | Dn}
This need only be specified if the current base qualification is not to apply for the dump-area. If you specify only a base qualification, all data of the corresponding call hierarchy will be output.
S=srcname
This need only be specified if dump-area is not to be within the current compilation unit, which must be within the call hierarchy.
PROC=program-id
This must be specified if dump-area is to apply only for the specified program. It must be within the call hierarchy. If dump-area ends with a PROC qualification, AID will output all data of this program.
If srcname in the S qualification and program-id are the same, only the PROG qualification need be written.
NESTLEV= level-number
level-number
A level number in the current call hierarchy
level-number can only be followed by dataname.
The %SDUMP command is to output a symbolic dump of all data defined at the specified level or to output dataname defined at the specified level of the call hierarchy.
filename
is the name of a file from a file definition in the FILE-SECTION of the DATA DIVISION. AID outputs the following information:
the file status and, if the file is open, the contents of the record area plus any record key.
dataname
is the name of a data item as defined in the source program, the name of a COBOL special register or a figurative constant.
dataname is an alphanumeric string consisting of up to 30 characters.
dataname [identifier][...][(index[,...])]
identifier
If dataname is not unambiguous within a program, it can be identified by being assigned to a particular group item with IN or OF. dataname must be assigned as many identifiers as are required to designate it unambiguously.
If it is not identified, AID only outputs data for dataname if a data definition is provided for it at level 01 or 77. If this is not the case, an error message is issued.
index
If dataname is the name of an element in a table, it can be indexed and subscripted as in a COBOL statement. The notation differs from COBOL only in that multiple indexes must be separated by a comma. If you specify the name of a table element without an index, the entire table is output.
index can be specified as follows:{ n | index-name | dataname | TALLY | arithmetic-expression }
COBOL special registers
LINAGE-COUNTER
RETURN-CODE
SORT-CCSN
SORT-CORE-SIZE
SORT-EOW
SORT-FILE-SIZE
SORT-MODE-SIZE
SORT-RETURN
TALLY
Figurative constants
ZERO
SPACE
HIGH-VALUE
LOW-VALUE
QUOTE
symbolic character
%NEST
Is an AID keyword which effects output of the current call hierarchy.
For the lowest hierarchical level AID outputs the name of the program and the source reference of the statement where the program was interrupted. For higher hierarchical levels AID outputs the name of the calling program and the source reference of the CALL statement.
%INDPOS |
%INDPOS
is an AID keyword that affects the position of the indexes in the output of Cobol arrays.
The %INDPOS keyword can only be used with [dump-area-OPERAND], if [dump-area-OPERAND] is "dataname". It is not applicable for "filename" or %NEST. For example, %INDPOS and %NEST keywords cannot appear in the same request.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[•][qua[•]] [dataname] [ %INDPOS]
- - - - - - - - - - - - - - - - - - - - - -- - - - - - - -
For example:
- if %INDPOS keyword is used in %SDUMP command in the following format:
%SDUMP LEVEL1.LEVEL2.LEVEL3(2,3,1:4), SECOND1.SECOND2(2,3) %INDPOS T=XFLAT,P=XMAX
or%SDUMP LEVEL1(2).LEVEL2(3).LEVEL3(1:4), SECOND1(2).SECOND2(3) %INDPOS T=XFLAT,P=XMAX
the output data name will be with indexes located after the corresponding element:
LEVEL1(2).LEVEL2(3).LEVEL3 (1:4);
SECOND1(2).SECOND2 (3).
- if the %INDPOS keyword is omitted in the command:
%SDUMP LEVEL1.LEVEL2.LEVEL3(2,3,1:4),SECOND1.SECOND2(2,3) T=XFLAT,P=XMAX
or
%SDUMP LEVEL1(2).LEVEL2(3).LEVEL3(1:4), SECOND1(2).SECOND2(3) T=XFLAT,P=XMAX
the output data name will be with indexes located at the end of the array name:
LEVEL1.LEVEL2.LEVEL3(2,3)(1:4):
SECOND1.SECOND2( 2 ,3) .
medium-a-quantity |
Defines the medium or media via which output is to take place and whether or not AID is to output additional information. If this operand is omitted and no declaration has been made in the %OUT command, AID assumes the default value T = MAX.
medium-a-quantity-OPERAND - - - - - - - - - - - - - - - - - - - - - - - - -
{T | H | Fn | P } = {MAX | MIN | XMAX | XFLAT }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
medium-a-quantity is described in full detail in the AID Core Manual (Related publications) [1].
T | Terminal output |
H | Hardcopy output (includes terminal output and cannot be specified together with T) |
Fn | File output |
P | Output to SYSLST |
MAX | Output with additional information |
MIN | Output without additional information |
XMAX | Output as with MAX, but extended by the type information: |
XFLAT | Output as with XMAX, but with the following restrictions: |
Data types
If you have specified the operand value XMAX or XFLAT, AID generates the output as with MAX, extended by the following type tags:
| |
size int-name int-value | Storage length in bytes. Specifies an element of the type integer. Decimal value (D); value of int-name. |
| |
size pointer-name pointer-value | Storage length in bytes. Specifies an element of the type pointer. Hexadecimal number (X); value of pointer-name. |
| |
size float-name float-value | Storage length in bytes. Specifies an element of the type floating point number. Floating point number displayed as a decimal fraction with |
| |
size chars-name | Storage length in bytes. Specifies an element of the type string, in other words an array |
string | String of printable characters (C); value of chars-name; If string is longer than 80 characters, with XFLAT only the first 72 |
<PACKED(size),D> packed-name = packed-value | |
size packed-name packed-value | Storage length in bytes. Specifies an element of the type packed decimal. Decimal value (D); value of packed-name. |
| |
size zoned-name | Storage length in bytes. Specifies an element of the type zoned decimal (unpacked |
zoned-value | Decimal value (D); value of zoned-name. |
| |
size binary-name | Storage length in bytes. Specifies an element of the type binary (binary number with a |
binary-value | Decimal fraction with a fixed comma position; value of binary- |
| |
size decimal-name | Storage length in bytes. Specifies an element of the type decimal (packed decimal |
decimal-value | Decimal fraction with a fixed comma position; value of decimal- |
| |
size unsign-name | Storage length in bytes. Specifies an element of the type integer without a sign |
unsign-value | Decimal value (D); value of unsign-name. |
| |
size area-name area-value | Storage length in bytes. Specifies a primary memory area. Memory dump in dump format, value of area-name. The dump If the output is longer than 80 characters, with XFLAT only the |
| |
size class-name class-value | Storage length in bytes. Specifies an element of the type CLASS. Symbolic constant (S), value of class-name. |
| |
size type | Primary memory length in bytes. Data type (CHARS, INT, FLOAT,...) if the array consists of a |
STRUCT | The array has a complex structure consisting of various data |
array-name dimension (a1) value1 | Specifies an element of the type array. The dimensions of the array. a1, a2, a3, ... specifies the subelements of the array, value1, |
|
size level | Storage length in bytes. Level of embedding of the structure or of a structure element |
struct-name sub-elements | bezeichnet ein Element vom Typ Struktur. Specifies an element of the type structure. Further elements which are contained in the structure. With |
Notes
Use the following syntax to query the entire content of a string, structure or array distributed over several lines:
%SDUMP
name{T | H | Fn | P} = {XMAX | MAX}
Use the following syntax to query the content of the array elements within the particular area:
%SDUMP
name[from:to] {T | H | Fn | P} = {XMAX | XFLAT | MAX}
Structures with XFLAT
For structures, AID generates various XFLAT data outputs depending on whether or not the %SDUMP command contains data operands.
%SDUMP without data operand
%SDUMP {T | H | Fn | P} = XFLAT
Only the type tag and the name are output (level 01). The output of the structure elements is omitted.
%SDUMP with a structure as operand
%SDUMP structure-name {T | H | Fn | P} = XFLAT
The structure name and the structure elements are output (level 02). Elements with elementary types are normally output, elements with array type with their name, and elements with structure type only with their name. Each element is preceded by a type tag. The name is extended by a number, the level of embedding.
%SDUMP with a substructure as operand
%SDUMP structure-name.substruct-name {T | H | Fn |P} = XFLAT
Also outputs the structure elements of the substructure (level 03).
Further levels of embedding can also be specified by the other substructure names being chained by a period:
structure-name.substruct1-name.substruct2-name.substruct3-name. ....
In order to query the entire content of a structure and of its substructures, use
XMAX instead of XFLAT.
Data type FILE for XMAX and XFLAT
The data type FILE consists of multiple elementary data types and has multiple keywords which begin with an underscore.
<FILE(size)>
f-name
<CHARS (file-name-length), C>
_FILE_NAME = |file-name|
<CLASS(size),S>
_OPEN_MODE = status
<CHARS (record-size), C>
_RECORD =
|record-content|
[
<INT (4), D>
_RECORD_NO = record-number
]
[
<CHARS (key-length), C>
_RECORD_KEY = |key-value|
]
f-name size file-name-length file-name status | Specifies an element of the type file. Storage length in bytes. Length of file-name. Fully qualified file name Current status of the file file-name, e.g. OPEN-OUTPUT, |
record-size record-content | Length of the current record which is output in _RECORD. Content of the current record enclosed in '|'. |
record-number key-length key-value | Relative record number in the case of relative file organization. Length of the primary key in the case of indexed file organization. Value of the primary key in the case of indexed file organization. |
Examples
Example 1:
With this command a symbolic dump of all DATA DIVISIONs in the current call hierarchy is requested. The value for medium-a-quantity is T=MAX. The compiler listing for this SDUMP output is given in section “Source listing”.
SRC_REF: 57SEA SOURCE: M0BS PROC: M0BS ***************************** _COMPILER = |COBOL2000 V01.4A02| _COMPILATION_DATE = |2006-06-23| _COMPILATION_TIME = |09:01:33| _PROGRAM_NAME = |MBOS| _EBCDIC-CCSN = |EDF03IRV| ZERO = 0 _ HIGH-VALUE = FF LOW-VALUE = 00 . SPACE = | | QUOTE = |"| 01_LAST_EXCEPTION 02_EXCEPTION_NAME = | | TALLY = +0 RETURN = +0
The %SDUMP output starts with a header containing the source reference of the statement at which the program was interrupted and the name of the current program. This is followed by the information of the test object, the figurative constants and special register.
TEXTDAT _FILE_NAME = |M.INP | _OPEN_MODE = OPEN-INPUT _RECORD = |THIS IS A FILE USED AS INPUT FOR A PROGRAM....................................| |..............................................................................| |..............................................................................| |.........................|
File information for the file TEXTDAT.
01 RECD 02 ITEM(1:61) ( 1) |D| ( 2) |I| ( 3) |E| ( 4) |S| ( 5) | | ( 6) |I| ( 7) |S| ( 8) |T| ( 9) | | ( 10) |E| ( 11) |I| ( 12) |N| ( 13) |E| ( 14) | | ( 15) |D| ( 16) |A| ( 17) |T| ( 18) |E| ( 19) |I| ( 20) |,| ( 21) | | ( 22) |D| ( 23) |I| ( 24) |E| ( 25) | | ( 26) |A| ( 27) |L| ( 28) |S| ( 29) | | ( 30) |E| ( 31) |I| ( 32) |N| ( 33) |G| ( 34) |A| ( 35) |B| ( 36) |E| ( 37) | | ( 38) |D| ( 39) |I| ( 40) |E| ( 41) |N| ( 42) |T| ( 43) | | ( 44) |F| ( 45) |U| ( 46) |E| ( 47) |R| ( 48) | | ( 49) |E| ( 50) |I| ( 51) |N| ( 52) | | ( 53) |P| ( 54) |R| ( 55) |O| ( 56) |G| ( 57) |R| ( 58) |A| ( 59) |M| ( 60) |M| ( 61) |,|
RECD is the data record definition for the file TEXTDAT. The contents are in the form of a table and have a permanently allocated index. The elements of the table are alphanumeric. For this reason the element contents are enclosed in vertical lines. Each value in the table is preceded by the appropriate index value in parentheses.
K = +1 SLF = 61 PROCESS-SWITCH = |0|
No level number is output for data elements of level 77 or 01.
01 A-Z-TAB 02 = |BCDEFGHIJKLMNOPQRSTUVWXYZ| 01 ABC-TAB 02 CHAR(1:26) ( 1) |A| ( 2) |B| ( 3) |C| ( 4) |D| ( 5) |E| ( 6) |F| ( 7) |G| ( 8) |H| ( 9) |I| ( 10) |J| ( 11) |K| ( 12) |L| ( 13) |M| ( 14) |N| ( 15) |O| ( 16) |P| ( 17) |Q| ( 18) |R| ( 19) |S| ( 20) |T| ( 21) |U| ( 22) |V| ( 23) |W| ( 24) |X| ( 25) |Y| ( 26) |Z| I = +1 01 NUMB-TAB 02 QNTY(1:26) ( 1) 0 ( 2) 0 ( 3) 0 ( 4) 0 ( 5) 0 ( 6) 0 ( 7) 0 ( 8) 0 ( 9) 0 ( 10) 0 ( 11) 0 ( 12) 0 ( 13) 0 ( 14) 0 ( 15) 0 ( 16) 0 ( 17) 0 ( 18) 0 ( 19) 0 ( 20) 0 ( 21) 0 ( 22) 0 ( 23) 0 ( 24) 0 ( 25) 0 ( 26) 0 J = +1
Group items A-Z-TAB, ABC-TAB and NUMB-TAB are in the form of a table. Each consists of 26 elements. ABC-TAB is alphanumeric and is indexed with index I. NUMB-TAB is numeric and is indexed with J. Both indexes are assigned the value 1.
NUMB-SUM = +1 PROC-SUM = +0.00 01 FRM-HEAD 02 = |LETTER NUMB PERCENT| 01 FRM-LINE 02 LETTER = |.| 02 = | | 02 NUMB = |.......| 02 = | | 02 PERCENT = |......| 01 FRM-FOOT 02 = |TOTAL: | 02 A-SUM = |......| 02 = | | 02 P-SUM = |......|
Definition of items in the header and footer.
Example2:
%SDUMP %NEST
The current call hierarchy is to be output.
|
|
|
The program was interrupted at the statement with the name 75EXI in program unit UNTER. The second line indicates the program unit BEISP, from which UNDER was called using the CALL statement. The CALL statement is located in statement line 41. The current call hierarchy has two levels.
Example 3:
Examples for XMAX and XFLAT
The following COBOL program should be tested:
IDENTIFICATION DIVISION. PROGRAM-ID. X-COB22. ENVIRONMENT DIVISION. CONFIGURATION SECTION. OBJECT-COMPUTER. PROGRAM COLLATING SEQUENCE IS MYSEQ. SPECIAL-NAMES. ALPHABET MYSEQ IS 'A' 'B' 'Y' 'Z'. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT RDAT ASSIGN TO DAT ACCESS DYNAMIC RELATIVE KEY RELKY RELATIVE FILE STATUS FS, FSEXT. DATA DIVISION. FILE SECTION. FD RDAT GLOBAL. 01 RSATZ GLOBAL. 02 FSEXT11 PIC S9(4) COMP. 02 FSEXT21 PIC X(146). WORKING-STORAGE SECTION. 01 FSEXT GLOBAL. 02 FSEXT1 PIC S9(2) COMP. 02 FSEXT2 PIC X(4). 01 FS GLOBAL. 02 FS1 PIC X. 02 FS2 PIC X. 01 DAT PIC X(8) VALUE "DATA.001". 01 RELKY PIC 9(2) VALUE 0. 01 DATABOX. 02 BNR USAGE BINARY. 02 INX USAGE INDEX. 02 PPP USAGE POINTER. 02 C0 PIC 9(9) COMP VALUE -12345.67890. 02 C0S PIC S9(9) COMP VALUE -12345.67890. 02 C5 PIC 9(9) COMP-5 VALUE -12345.67890. 02 C5S PIC S9(9) COMP-5 VALUE -12345.67890. 02 C0V PIC 9(9)V9(5) COMP VALUE -12345.67890. 02 C0SV PIC S9(9)V9(5) COMP VALUE -12345.67890. 02 C5V PIC 9(9)V9(9) COMP-5 VALUE -12345.67890. 02 C5SV PIC S9(9)V9(9) COMP-5 VALUE -12345.67890. 02 C3 PIC 9(9) COMP-3 VALUE -12345.67890. 02 C3S PIC S9(9) COMP-3 VALUE -12345.67890. 02 C3V PIC 9(9)V9(9) COMP-3 VALUE -12345.67890. 02 C3SV PIC S9(9)V9(9) COMP-3 VALUE -12345.67890. 02 C1 COMP-1 VALUE -12345.67890. 02 C2 COMP-2 VALUE -12345.67890. 02 Z20 PIC 9(20) VALUE -98765432101234567890. 02 Z16S PIC S9(16) SIGN IS LEADING SEPARATE VALUE -98765432101234567890. 02 Z16T PIC S9(16) SIGN IS TRAILING VALUE -98765432100123456789. 02 D20C DISPLAY VALUE "-98765432101234567890". 02 NAT PIC N(46) VALUE N"1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890". 02 G REDEFINES NAT group-usage national. 03 G1 pic N(10). 03 G2 pic N(26). 03 G3 pic N(10). ********** 1,2,3 -DIMENSION TABLEs ********** 01 TXT PIC X(48) VALUE "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890AB". 01 TAB1 REDEFINES TXT. 02 ITEM1 PIC A(4) OCCURS 12. 01 TAB2 REDEFINES TXT. 02 TAB2-1 03 TAB2-2 01 TAB3 REDEFINES TXT. 02 TAB3-1 OCCURS 2. 03 TAB3-2 OCCURS 3. 04 TAB3-3 PIC A(1) OCCURS 8. PROCEDURE DIVISION. START-RUN SECTION. FIRST-PARAGRAPH. OPEN OUTPUT RDAT IF FS NOT = "00" GO TO END-RUN END-IF MOVE "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" TO FSEXT21. END-RUN. STOP RUN. END PROGRAM X-COB22.
The following variants show the effect of various specifications for XFLAT and XMAX:
XFLAT without data operand
When you specify XFLAT without an operand, of the structures only the topmost level 01 is output; long strings, arrays and areas are output in truncated form.
|
XFLAT with DATABOX structure as operand
When you specify a structure for XFLAT (DATABOX here), level 02 of the structure is also output.
|
XMAX with sub strucure G in DATABOX as operand
With XMAX for the substructure G in DATABOX the complete substructure of G (sreas in dump format) is output in full length:
/%SD g in databox t=xmax SRC_REF: 92STO SOURCE: X-COB22 PROC: X-COB22 ********* <STRUCT (92) > 02 DATABOX.G <AREA(20),X> 03 G1 = 00310032 00330034 00350036 00370038 12345678 00390030 90 <AREA(52),X> 03 G2 = 00410042 00430044 00450046 00470048 ABCDEFGH 0049004A 004B004C 004D004E 004F0050 IJKLMNOP 00510052 00530054 00550056 00570058 QRSTUVWX 0059005A YZ <AREA(20),X> 03 G3 = 00310032 00330034 00350036 00370038 12345678 00390030 90
XFLAT with TAB3 structure as operand
/%SD tab3 t=xflat SRC_REF: 92STO SOURCE: X-COB22 PROC: X-COB22 <STRUCT(48)> 01 TAB3 <ARRAY(48),STRUCT> 02 TAB3-1( 1: 2)
XFLAT and XMAX with an array as operand
XFLAT for single array element:
/%SD tab3-1(2) t=xflat SRC_REF: 92STO SOURCE: X-COB22 PROC: X-COB22 *** <STRUCT(24)> 02 TAB3-1( 2) <ARRAY(24),STRUCT> 03 TAB3-2( 1: 3)
XFLAT for 2-dimensional array element:
/%SD tab3-2(2,3) t=xflat SRC_REF: 92STO SOURCE: X-COB22 PROC: X-COB22 *** <STRUCT(8)> 03 TAB3-1.TAB3-2( 2, 3) <ARRAY(8),CHARS> 04 TAB3-3( 1: 8)
XMAX for 3-dimensional array element with specification of an area:
/%SD tab3-3(2,3,5:8)t=xmax SRC_REF: 92STO SOURCE: X-COB22 PROC: X-COB22 *** <ARRAY(4),CHARS> TAB3-1.TAB3-2.TAB3-3( 5: 8) ( 5) |9| ( 6) |0| ( 7) |A| ( 8) |B|