 
 
 
 
 
 
 


 
 
 
 
 
 


 
 6.2.10   DISPLAY Statement
   The DISPLAY statement transfers the contents of each operand to the output
   device.  The contents are displayed on the output device in the order,
   left to right, in which the operands are listed.
   >_Workstation_> Under AIX, OS/2, and Windows, the target file is
   determined by checking the COBOL environment-name (CONSOLE, SYSIN, SYSIPT,
   SYSOUT, SYSLIST, SYSLST, SYSPUNCH, and SYSPCH).  If an environment
   variable is defined corresponding to the COBOL environment-name, the value
   of the environment-variable is used as the system file identifier.  For
   more information on environment-variables, see the IBM COBOL Programming
   Guide for your platform.
   For SYSPUNCH and SYSPCH, the DISPLAY statement will fail unless the
   corresponding environment variable is set to point to a valid target.
   <_Workstation_<
    ___ Format _____________________________________________________________ 
   |                                                                        |
   |              <__________________                                       |
   | >>__DISPLAY____ _identifier-1_ _|____________________________________> |
   |                |_literal-1____|                                        |
   |                                                                        |
   | >__ ________________________________ __ ________________________ ___>< |
   |    |_UPON__ _mnemonic-name-1______ _|  |_ ______ __NO ADVANCING_|      |
   |            |_ environment-name-1 _|      |_WITH_|                      |
   |                                                                        |
   |________________________________________________________________________|
   identifier-1
 
       If it is numeric and is not described as an external decimal, the
       identifier-1 is converted automatically to external format, as
       follows:
-             Binary or internal decimal items are converted to external
           decimal.  Negative signed values cause a low-order sign overpunch.
 
-   X         Internal floating-point numbers are converted to external
 X         floating-point numbers for display, such that:
 
-   X             A COMP-1 item will display as if it had an external
 X             floating-point PICTURE clause of -.9(8)E-99
 
-   X             A COMP-2 item will display as if it had an external
 X             floating-point PICTURE clause of -.9(17)E-99
 
 
 
 
No other identifiers require conversion.
 X Data items defined with USAGE IS POINTER are converted to an external
 X decimal number that would have a PICTURE clause of PIC 9(10).
 X Data items defined with USAGE IS PROCEDURE-POINTER or USAGE IS OBJECT
 X REFERENCE cannot be specified in a DISPLAY statement.
   Index names or data items defined with USAGE IS INDEX cannot be specified
   in a DISPLAY statement.
 X Date fields are treated as non-dates when specified in a DISPLAY
 X statement.  That is, the DATE FORMAT is ignored, and the content of the
 X data item is transferred to the output device as is.
 X DBCS data items, explicitly or implicitly defined as USAGE DISPLAY-1, are
 X transferred to the sending field of the output device.  Under OS/390 and
 X VM, for proper results, the output device must have the capability to
 X recognize DBCS shift-out and shift-in control characters.
 X Both DBCS and non-DBCS operands can be specified in a single DISPLAY verb.
- 
   literal-1
-  
       Can be any figurative constant.  When a figurative constant is
       specified, only a single occurrence of that figurative constant is
       displayed.
 Each numeric literal must be an unsigned integer.
 
 X     Signed numeric literals and non-integer numeric literals are allowed.
 
 X     Floating-point literals are allowed.
 
 X     DBCS literals are allowed.
 
 X     The ALL figurative constant can be used with DBCS literals in a
 X     DISPLAY verb.
 
- 
   UPON
-  
 X     mnemonic-name or environment-name must be associated in the
       SPECIAL-NAMES paragraph with an output device.
 >_Host_> A default logical record size is assumed for each device, as
       follows:
 
-             The system logical output device = 120 characters
-             The system punch device = 80 characters
-             The console = 100 characters
 
 A maximum logical record size is allowed for each device, as follows:
 
-             The system logical output device = 255 characters
-             The system punch device = 255 characters
-             The console = 100 characters
 
 Note:  On the system punch device, the last eight characters are used
       for PROGRAM-ID name.  <_Host_<
 When the UPON phrase is omitted, the system's logical output device is
 X     assumed.  The list of valid environment-names in a DISPLAY statement
 X     is contained in Table 8 in topic 4.1.3.
 
- 
   WITH NO ADVANCING
-  
       When specified, the positioning of the output device will not be
       changed in any way following the display of the last operand.  If the
       output device is capable of positioning to a specific character
       position, it will remain positioned at the character position
       immediately following the last character of the last operand
       displayed.  If the output device is not capable of positioning to a
       specific character position, only the vertical position, if
       applicable, is affected.  This can cause overprinting.
 If the WITH NO ADVANCING phrase is not specified, then after the last
       operand has been transferred to the output device, the positioning of
       the output device will be reset to the leftmost position of the next
       line of the device.
 >_Host_> Under OS/390 and VM, COBOL does not support output devices
       that are capable of positioning to a specific character position.  See
       the IBM COBOL Programming Guide for your platform for more information
       about the DISPLAY statement.  <_Host_<
 
 
The DISPLAY statement transfers the data in the sending field to the
   output device.  The size of the sending field is the total character count
   of all operands listed.  If the output device is capable of receiving data
   of the same size as the data item being transferred, then the data item is
   transferred.  If the output device is not capable of receiving data of the
   same size as the data item being transferred, then one of the following
   applies:
-         If the total character count is less than the device maximum character
       count, the remaining rightmost characters are padded with spaces.
 
-         If the total character count exceeds the maximum, as many records are
       written as are needed to display all operands.  Any operand being
       printed or displayed when the end of a record is reached is continued
       in the next record.
 
 
 X If a DBCS operand must be split across multiple records, it will be split
 X only on a double-byte boundary.
 X >_Host_> Under OS/390 and VM, the shift code compensation is required
 X under this case.  That is, when a DBCS operand is split across multiple
 X records, the shift-in character needs to be inserted at the end of the
 X current record, and the shift-out character needs to be inserted at the
 X beginning of the next record.  A space is padded after the shift-in
 X character, if necessary.  These additional inserted shift codes and spaces
 X are included in the count while the compiler is calculating the number of
 X records required.
 X After the last operand has been transferred to the output device, the
 X device is reset to the leftmost position of the next line of the device.
 X If a DBCS data item or literal is specified in a DISPLAY verb, the size of
 X the sending field is the total character count of all operands listed,
 X with each DBCS character counted twice, plus the necessary shift codes for
 X DBCS.  <_Host_<
   Notes:
    1.  The DISPLAY statement causes the printer to space before printing.
    2.  The DISPLAY statement can be used to identify data records that have
       caused one of the following conditions:
-             A size error
-             An invalid key
-             An overflow condition
-             A status key returned as a value other than zero
 
Such records can be printed, with an identifying message, on some
       other medium than that used for valid output.  Thus, all records for
       one execution that need special handling are separately printed.
 
 © Copyright IBM Corp. 1991, 1998
  © Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation.  All rights reserved.
Return to library:  
z/OS | 
z/OS.e | 
TPF |
z/VSE |
z/VM |
IBM Hardware |
IBM System z Redbooks 
Glossary:  
IBM terminology
Publications:  
How to order publications
Readers:  
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Library management:  
Download IBM Softcopy Librarian
Contacts:  
Contact z/OS
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks 
of Adobe Systems incorporated.