IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DISPLAY output vertically


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ziddiguy

New User


Joined: 20 Jul 2007
Posts: 14
Location: Germany

PostPosted: Wed Apr 30, 2008 11:32 pm
Reply with quote

Hi Guys,

Could someone tell me how can I display output in cobol vertically

e.g.
Name Pic X(4) value "TEST"


Output :-
T
E
S
T

How can i display above output
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Apr 30, 2008 11:53 pm
Reply with quote

Code:

03  WS-SUB  PIC 9(04) BINARY.
03  WS-NAME PIC X(04) VALUE 'TEST'.

PERFORM VARYING WS-SUB FROM 1 BY 1
    UNTIL WS-SUB > LENGTH OF WS-NAME
         DISPLAY WS-NAME (WS-SUB:1)
END-PERFORM.

I hope this is only an exercise or homework assignment. icon_wink.gif

Regards,

Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts XDC SDSF output to temp dataset CLIST & REXX 4
Search our Forums:

Back to Top