The %DISPLAY command is used to output memory contents, addresses, lengths, system information and AID literals and to control feed to SYSLST.
AID edits the data in accordance with the definition in the source program, unless you select another type of output by means of type modification.
Output is via SYSOUT, SYSLST or to a cataloged file.
With data you specify data items, their addresses and lengths, statements, data definitions, registers, execution counters of subcommands, system information, COBOL special registers and figurative constants. Here you also define AID literals or you control feed to SYSLST.
With medium-a-quantity you specify the output medium AID uses and whether or not additional information is to be output. This operand disables a declaration made via the %OUT command, but only for the current %DISPLAY command.
Command | Operand |
%D[ISPLAY] |
|
A %DISPLAY command which does not have a qualification for data addresses data of the current program.
If you do specify a qualification, you can access data in a dump file or in any other compilation unit or program unit which has been loaded.
If the medium-a-quantity operand is not specified, AID outputs the data in accordance with the declarations in the %OUT command or, by default, to SYSOUT, together with additional information (AID Core Manual (Related publications) [1]).
In addition to the operand values described here, you can also use the operand values described for debugging on machine code level (see manual AID - Debugging on Machine Code Level (Related publications) [2]).
Immediate entry of the command right after loading the program is not recommended as not all entries in the DATA DIVISION will have been initialized (e.g. record definitions and special registers).
This command can be used both in the loaded program and in a dump file.
%DISPLAY does not alter the program state.
The following „names“ are provided for any compilation unit automatically:
| the compiler that compiled the object |
| the date of compilation |
| the time of compilation |
_LAST_EXCEPTION | Information about the last exception state (available only as of COBOL2000 V1.3A) |
| ID name of the object |
| the name of the EBCDIC variant which is assumed in the event of conversions between alphanumeric and national data (available only as of COBOL2000 V1.4A) |
AID as of version 3.4B10 supports also the output of data in different EBCDIC character sets and ASCII character sets. As BS2000 terminals only support selected EBCDIC character sets directly, the following character sets must be distinguished:
Character set of the data: Character set, in which the data is available or interpreted
Character set of the output: Character set, with which the data is displayed
AID interprets the data using the character set that is specified with the %DISPLAY command. If no character set is specified there, the character set specified by the CCS
operand of the %AID command is used.
First of all you must specify the character set of the output with the MODIFY-TERMINAL-OPTIONS command. It must be an EBCDIC character set that is supported by the terminal. UTFE is not allowed. Furthermore the character set of the output must be in the same group as the character set of the data. If, for example, the character set of the data is ISO88592, first of all specify the corresponding character set of the output with /MOD-TERM-OPT CODE=EDF042 (see the XHCS (Related publications) manual).
%DISPLAY <data-start> { %C|%X }[Lddd] ['<coded-character-set>']
If you prompt the %DISPLAY command with the %C
or %X
storage type, AID outputs the characters in accordance with the explicitly specified character set <coded-character-set>
, or in accordance with the current character set CCS
if '<coded-character-set>
' is not specified.%C
and %X
define different output layouts.
%DISPLAY <char-variable> ['<coded-character-set>']
If char
variables are to be output, AID outputs them in accordance with the explicitly specified character set <coded-character-set>
, or in accordance with the current character set CCS
. The output layout differs from the layouts that are determined by %C
or %X
.
To display the current character set CCS
use the following AID command:
%SHOW %AID
To modify the current character set use the following AID command:
%AID CCS = {<coded-character-set>|*USRDEF}
data |
This operand defines the information AID is to output. You may output file definitions, the contents, address and length of data items and special registers, figurative constants, as well as the addresses of statements. The contents of registers and execution counters as well as the system information relevant to your program can be addressed via keywords. AID literals can be defined to improve the readability of debugging logs, and feed to SYSLST can be controlled for the same purpose.
AID edits data items in accordance with the definitions in the source program, provided that you have not defined another type of output using a type modification (see AID Core Manual (Related publications) [1]). If the contents do not match the defined storage type, output is rejected and an error message is issued. Nevertheless the contents of the data element can be viewed, for instance by employing the type modification %X to edit the contents in hexadecimal form.Modification of the output type via the operand AS {BIN/CHAR/DEC/DUMP/HEX} is supported for the last time in this version (see AID Core Manual (Related publications) [1], appendix).
If you enter more than one data operand in a %DISPLAY command, you may switch from one operand to another between the symbolic entries described here and the non-symbolic entries described in the manual for debugging on machine code level (see manual AID - Debugging on Machine Code Level (Related publications) [2]). Symbolic and machine-oriented specifications can also be combined within a complex memory reference, provided no explicit restrictions exist (see section “Symbolic memory references”).
If for data a name is specified which is not contained in the LSD records, AID issues an error message. The other data of the same command will be processed in the normal way.
data-OPERAND - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{ [•][qua•][...] {
filename
| dataname
| statement-name
| source-reference
| keyword
| compl-memref
}
| {%@ | %L | %C | %UTF}[•][qua•][...] {
filename
| dataname
| compl-memref
}
| %L=(expression)
| AID-literal
| feed-control
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
•
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
Qualifications need only be specified if an address operand does not apply to the current AID work area of if an address is to be referenced which is not in the current compilation unit or the current program.
E={VM | Dn}
Specified only if the current base qualification (see %BASE) is not to apply for a file/data/statement name, source reference or keyword.
S=srcname
Specified only if data is not contained in the current compilation unit.
PROC=program-id
Specified only if a file name, data name or statement name is addressed which is not contained in the current program (see chapter “COBOL-specific addressing") or which is not unique in the current compilation unit.
It is also required for a global data name that is locally hidden.
If srcname in the S qualification is the same as the program-id, only the PROG qualification need be written.
NESTLEV= level-number
level-number
A level number in the current call hierarchy
level-number has to be followed by dataname.
The syntax indicates that the %DISPLAY command is to output the data item dataname defined at the level level-number of the current 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 data record area and any record key.
dataname
specifies the name of a data item, the name of a COBOL special register or a figurative constant as defined in the source program.
If dataname is not unique within a program, it can be identified.
If dataname is the name of a table element, it can be indexed or subscripted in the same way as in a COBOL statement (see section “Symbolic memory references” on dataname).
dataname [identifier][...][(index[,...])]
identifier
dataname is assigned to a particular group item with IN or OF. dataname must have 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
is written as in a COBOL statement, except that in the AID command multiple indexes must be separated by commas.
index can be specified as follows:
{ n | index-name | dataname | TALLY | arithmetic-expression }
You can specify a range of indexes:
index1 : index2
This designates the range between index1 and index2. Both must lie within the index limits, and index1 must be less than or equal to index2.
COBOL special registers1
LINAGE-COUNTER RETURN-CODE SORT-CCSN SORT-CORE-SIZE SORT-EOW SORT-FILE-SIZE SORT-MODE-SIZE SORT-RETURN TALLY
1Most COBOL special registers exist only if the corresponding language resources are used.
Figurative constants
The address selector cannot be used with figurative constants.
ZERO SPACE HIGH-VALUE LOW-VALUE QUOTE symbolic character
statement-name
designates the address of the first statement in a section or paragraph in the PROCEDURE DIVISION.
{ L'section' | L'paragraph' [IN L'section']}
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'
With the subsequent pointer operator (->) AID outputs 4 bytes of the program code generated for the first statement in the section or paragraph.
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[m]’ | S’xverb[m]’
for lines containing a COBOL verb.
With the subsequent pointer operator (->) AID outputs 4 bytes of the program code generated for the statement.
keyword
Here you may specify all the keywords for program registers, AID registers, system tables and the one for the execution counter or the symbolic localization information (see AID Core Manual (Related publications) [1]).
keyword can only be preceded by a base qualification.
%n General register, 0 <= n <= 15 %nD|E Floating-point register, n = 0,2,4,6 %nQ Floating-point register, n = 0,4 %nG AID general register, 0 <= n <= 15 %nDG AID floating-point register n = 0,2,4,6 %MR All 16 general registers in tabular form %FR All 4 floating-point registers with double precision edited in tabular form %PC Program counter %CC Condition code %PM Program mask %AMODE Addressing mode of the test object %PCB Process control block %PCBLST List of all process control blocks %SORTEDMAP List of all CSECTs and COMMONs of the user program (sorted by name and address) long names are truncated %MAP [CTX=context] List of all CSECTs and COMMONs of all contexts of the user program or of the context designated by the context qualification; the names are output in full, not abbreviated (for further operands see AID Core Manual (Related publications) [1]) %LINK Name of the segment dynamically loaded last %HLLOC(memref) Localization information on the symbolic level for a memory reference in the executable part of the program (high-level location) %LOC(memref) Localization information on machine code level for a memory reference in the executable part of the program (low-level location) %•subcmdname Execution counter %• Execution counter of the currently active subcommand
compl-memref
The following operations may occur in a compl-memref (see AID Core Manual (Related publications) [1]):
byte offset (•)
indirect addressing (->)
type modification (%T(dataname), %X, %C, %E, %P, %D, %F, %A, %S, %SX, %UTF16)
length modification (%L(...), %L=(expression), %Ln)
Character conversion functions %C() and %UTF16()
If a statement name or a source reference is to be used as a memory reference, it must be followed by a pointer operator ( -> ). Without the pointer operator the statement name and source reference can be used anywhere where hexadecimal numbers can be written. Using the type modification, data may be edited in another form since the output type changes with the storage type.
With the length modification you can define the output length yourself, e.g. if you wish to output only parts of a data item or display a data item using the length of another data item. It is only permitted to exceed the implicit area limits of an address with type or length modification after first using %@(dataname)-> to switch to machine code level, on which the area comprises the virtual memory occupied by the loaded program.
%@(...)
With the address selector you can output the start address of a data entry, a data item, a special register or a complex memory reference (see AID Core Manual (Related publications) [1]). The address selector cannot be used for constants. However, the statement names, the source references and the figurative constants among these can be specified by a subsequent pointer.
Examples
%D %@(L'LEAD'->)
%D %@(S'97MOV'->)
%L(...)
With the length selector you can output the length of a data entry, a data item or a special register (see AID Core Manual (Related publications) [1]).
Example: %DISPLAY %L(ITEM1)
The length of ITEM1 is output.
%L=(expression)
With the length function you can have a value calculated.
expression is formed from memory references and arithmetic operators (see AID Core Manual (Related publications) [1]).
Example: %DISPLAY %L=(ITEM1)
If ITEM1 is an integer (type %F), the contents of ITEM1 will be output. Otherwise AID issues an error message.
%UTF16(...) or %C(...)
The %UTF16() function converts strings from 1-byte EBCDIC encoding to UTF16 encoding; the %C function performs conversion in the other direction.
For further information, see the AID Core Manual (Related publications) [1].
AID literal
All AID literals described in the AID Core Manual (Related publications) [1], may be specified:
{C'x...x' | 'x...x' | U'x...x' } Character literal {X'f...f'} Hexadecimal literal {B'b...b'} Binary literal [{+|-}]n Integer #'f...f' Hexadecimalnumber [{+|-}]n.m Fixed-point number [{+|-}]mantisseE[{+|-}]exponent Floating-point number
feed-control
For output to SYSLST, print editing can be controlled by the following two keywords, where:
%NP | results in a page feed |
%NL[(n)] | results in a line feed by n blank lines. |
medium-a-quantity |
Defines the medium or media via which output is to take place, and whether additional information is to be output by AID. If this operand is omitted and no declaration has been made using the %OUT command, AID uses the presetting 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 | In the %DISPLAY command the operand value XMAX is not taken into account, as a result of which the behavior is identical to the default value MAX. |
XFLAT | In the %DISPLAY command the operand value XFLAT is not taken into account, as a result of which the behavior is identical to the default value MAX. |
Examples
Specification of several medium-a-quantity operands
%DISPLAY DATARECORD F1=MAX, H=MIN
%DISPLAY E=D1.PROG=EXAMPLE.FCOMP3S,'CONTENTS OF DUMP'
Here the contents of a dump are evaluated.** D1: DUMP.EXAMPLE ************************************************************ FCOMP3S = +999456989 CONTENTS OF DUMP
%DISPLAY %L=(S'13ADD'-S'12MOV')
AID outputs the length of the machine code sequence generated for statement 12MOV.+52
- %BASE
%DISPLAY L'PROCESSING'
%BASE switches back to the AID standard work area. AID then outputs the address of the first instruction in the paragraph PROCESSING as a hexadecimal number.** ITN: #00010053'***TSN:6567***********************************************' SRC_REF: 45INIT SOURCE: M0BS PROC: M0BS ****************************** PROCESSING = 00000A84
%DISPLAY L'PROCESSING'->
AID outputs 4 bytes of the machine code contained at the address of the paragraph PROCESSING. The pointer operator switches to the machine code level, which causes AID to display an additional header.CURRENT PC: 00000A04 CSECT: M0BS ****************************************** V'00000A84' = M0BS + #00000A84'' 00000A84 (00000A84) 18001800 ....
%DISPLAY %HLLOC(L'OUT1' IN L'PUTOUT'->)
AID outputs symbolic localization information for paragraph OUT1 in section PUTOUT.V'00000C2C' = SMOD : EXAMPLE PROC : EXAMPLE SECTION : PUTOUT PARAGRAPH: OUT1 SRC-REF : 77 LABEL : OUT1
%DISPLAY %LOC(L'OUT1' IN L'PUTOUT'->)
AID outputs localization information on machine code level for paragraph OUT1 in section PUTOUT.V'00000C2C' = PROG : EXAMPLE LMOD : %ROOT SMOD : EXAMPLE OMOD : EXAMPLE CSECT : EXAMPLE (00000000) + 00000C2C
The program M1BS is loaded and started
/LOAD-EXECUTABLE-PROGRAM M1BS,TEST-OPT=*AID
% BLS0500 PROGRAM 'M1BS', VERSION ' ' OF '91-09-04' LOADED.
Unpacked numbers
12345
1234N
Packed numbers
12345
1234N
% IDA0N51 PROGRAM INTERRUPT AT LOCATION '008702 (M1BS), (CDUMP), EC=68
% IDA0N45 DUMP DESIRED? REPLY (Y = USER/AREA DUMP; Y,SYSTEM = SYSTEM ,N=NO)?
% EXC0077 PROGRAM IS STILL LOADED AND IN 'HOLD-PROGRAM' MODE. PROGRAM RUN MAY BE
CONTINUED WITH /RESUME-PROGRAM
Your program has encountered an error. Now you want to know which statement caused this error. To find this out, enter %DISPLAY %HLLOC for the address at which the program was interrupted by the error:
/%DISPLAY %HLLOC(V'8702')
** ITN: #0000004D'***TSN:4192***********************************************'
CURRENT PC: 00008702 CSECT: UPRO ****************************************
V'00008702' = SMOD : UPRO
PROC : UPRO
SRC-REF : 33COM
/%D %LOC(V'8702')
V'00008702' = PROG : M1BS
LMOD : %ROOT
SMOD : UPRO
OMOD : UPRO
CSECT : UPRO (00008230) + 000004D2
%DISPLAY ALPHA-CHAR(I)
Let ALPHA-CHAR be defined as in example 10 and index I contain the value 5. The 5th element in the table will be output:ALPHA-CHAR( 5) = |E|
%DISPLAY ALPHA-CHAR
The ALPHA-CHAR element is contained in a table 26 times and defined in the DATA DIVISION as follows:
01 A-Z-TAB1.
02 ALPHA-CHAR PIC X OCCURS 26 INDEXED BY I.
As no index was specified in %DISPLAY, AID outputs all the elements with this name:
** ITN: #00010053'***TSN:6567***********************************************' SRC_REF: 45INIT SOURCE: EXAMPLE PROC: EXAMPLE ************************** ALPHA-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|
Comparison of AID and COBOL output of data items:
IDENTIFICATION DIVISION. PROGRAM-ID. PROG-NUM. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. TERMINAL IS T. DATA DIVISION. WORKING-STORAGE SECTION. 01 UNPKD1 PIC 99999. 01 UNPKD2 PIC S999V99 VALUE ZERO. 01 PCKD1 PIC 99999 COMP-3. 01 PCKD2 PIC S999V99 COMP-3 VALUE ZERO. 01 FLOAT1 PIC +999.99E-99. 01 FLOAT2 COMP-1. 01 FLOAT3 COMP-1 VALUE 12. 01 FLOAT4 COMP-2. 01 FLOAT5 COMP-2 VALUE +123456789.1234567E+10. 01 BIN1 PIC 99999 BINARY. 01 BIN2 PIC S9999 BINARY VALUE ZERO. PROCEDURE DIVISION. UNPKD. DISPLAY "Unpacked numbers" UPON T. MOVE 12345 TO UNPKD1. DISPLAY UNPKD1 UPON T. MOVE -123.45 TO UNPKD2. DISPLAY UNPKD2 UPON T. PCKD. DISPLAY "Packed numbers" UPON T. MOVE 12345 TO PCKD1. DISPLAY PCKD1 UPON T. MOVE UNPKD2 TO PCKD2. DISPLAY PCKD2 UPON T. FLOAT. DISPLAY "Floating-point numbers" UPON T. MOVE 12345 TO FLOAT1. MOVE 12345 TO FLOAT2. DISPLAY FLOAT1 UPON T. DISPLAY FLOAT2 UPON T. DISPLAY FLOAT3 UPON T. MOVE UNPKD2 TO FLOAT4. DISPLAY FLOAT4 UPON T. DISPLAY FLOAT5 UPON T. BIN. DISPLAY "Binary numbers" UPON T. MOVE 12345 TO BIN1. DISPLAY BIN1 UPON T. MOVE UNPKD2 TO BIN2. DISPLAY BIN2 UPON T. END. STOP RUN.
COBOL output
Unpacked numbers 12345 1234N Packed numbers 12345 1234N Floating-point numbers +123.45E 02 +.123450E+05 +.120000E+02 -.123450000000000E+03 +.123456789123457E+19 Binary numbers 12345 012L
AID output
%D UNPKD1, UNPKD2
SRC_REF: 44DIS SOURCE: UPRONUM PROC: UPRONUM **************************
UNPKD1 = 12345
UNPKD2 = -123.45
%D PCKD1,PCKD2
PCKD1 = 12345
PCKD2 = -123.45
%D FLOAT1,FLOAT2,FLOAT3,FLOAT4,FLOAT5
FLOAT1 = +.12345 E+005
FLOAT2 = +.1234500 E+005
FLOAT3 = +.1200000 E+002
FLOAT4 = -.1234499999999999 E+003
FLOAT5 = +.1234567891234566 E+019
%D BIN1, BIN2
BIN1 = 12345
BIN2 = -123