Help Needed in simple display



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Help Needed in simple display

Postby ram23bal » Mon Jan 05, 2009 8:17 pm

Hi All,

I use the following display statements

DISPLAY WS-ONE
WS-TWO
WS-THREE
WS-FOUR
WS-FIVE

This wil display as below

WS-ONE(field value) WS-TWo(field value) WS-THREE(field value) ...

WS-XXX are working storage variables.




Now I need to modify the above display by putting an IF condition for WS-THREE.

Note

I tried below

DISPLAY WS-ONE
DISPLAY WS-TWO
IF WS-logic = c
DISPLAY WS-THREE
ELSE
DISPLAY WS-DUMMY
END-IF
DISPLAY WS-FOUR
DISPLAY WS-FIVE


but the display goes to next line. How to make it display in the same line.
ram23bal
 
Posts: 33
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help Needed in simple display

 

Re: Help Needed in simple display

Postby CICS Guy » Mon Jan 05, 2009 9:40 pm

     IF WS-logic = c
     DISPLAY  WS-ONE WS-TWO WS-THREE WS-FOUR WS-FIVE
     ELSE
     DISPLAY  WS-ONE WS-TWO WS-FOUR WS-FIVE
     END-IF
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Help Needed in simple display

Postby ram23bal » Tue Jan 06, 2009 8:39 am

Hi

Thanks for the reply. As per your answer display will be in two different line. I want it in same line.
ram23bal
 
Posts: 33
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help Needed in simple display

Postby ram23bal » Tue Jan 06, 2009 9:05 am

Sorry CICSguy I didnt read your reply properly. I have bulk of items to display and I dont want to repeat the display... Is there any conditional diaplays in COBOL...
ram23bal
 
Posts: 33
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help Needed in simple display

Postby dick scherrer » Tue Jan 06, 2009 9:42 am

Hello,

Is there any conditional diaplays in COBOL...
Only what CG posted.

You might consider building the display area field by field (using STRING and/or refeence modification) and only issue one DISPLAY of the area once it has been built. Each time DISPLAY is issued, a new line is created.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Help Needed in simple display

Postby CICS Guy » Wed Jan 07, 2009 1:06 am

ram23bal wrote:I have bulk of items to display and I dont want to repeat the display... Is there any conditional diaplays in COBOL...
Nope, but you could 'build' a single line of the displays (conditionally) and then display the correct line......
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post