Hi guys.
Can any one plz explain .
how to display "Indian army" vertically using cobol. if Indian army declared as a variable in pgm.
display vertically using cobol.
Re: display vertically using cobol.
Hello.
There's not a simple one-statement solution for this that I'm aware of, so it would have to be something along these lines:
The "(WA-SUB:1)" bit is a substring that goes to the character indicated by WA-SUB and returns the characters for length of 1.
If you are doing this on a report, you reserve a space in the output line for a single character, then use the substring to move in the next character before you print the next line.
There's not a simple one-statement solution for this that I'm aware of, so it would have to be something along these lines:
Code: Select all
01 WA-MESSAGE PIC X(11) VALUE 'Indian Army'.
01 WA-SUB PIC S9(4) COMP.
.
.
PERFORM VARYING WA-SUB FROM 1 BY 1
UNTIL WA-SUB > 11
DISPLAY WA-MESSAGE (WA-SUB:1)
END-PERFORM
If you are doing this on a report, you reserve a space in the output line for a single character, then use the substring to move in the next character before you print the next line.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute