Using WTO Like COBOL DISPLAY

The following code exhibits a formatted message including selected data fields in the manner of the COBOL DISPLAY statement.  The execute form of the WTO macro in the upper portion of code references the list form of the WTO macro in the lower portion.

         MVC   MSGITCD(3),INITCD
         UNPK  MSGCNT(11),INCNT
         OI    MSGCNT+10,X'F0'
         MVC   DISPLAY+4(80),MSGITEM
         WTO   MF=(E,DISPLAY)
*
  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
*
DISPLAY  WTO   '1234567890123456789012345678901234567890123456789012345X
               6789012345678901234567890',                             X
               ROUTCDE=(2,11),DESC=7,MF=L
*
MSGITEM  DC    CL80' '
         ORG   MSGITEM
         DC    CL10' '
         DC    CL3'***'
         DC    CL6' ITEM='
MSGITCD  DS    CL3
         DC    CL7' COUNT='
MSGCNT   DS    CL11
         ORG
*
INREC    DS    0CL80
INITCD   DS    CL3             ITEM CODE
INCNT    DS    PL6             COUNT
INDESC   DS    CL30            DESCRIPTION
         DS    CL37            FILLER

Copyright © 2006 The Stevens Computing Services Company, Inc.  All rights reserved.