Advancing with a variable



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

Advancing with a variable

Postby ctrevino » Wed Sep 29, 2010 7:56 pm

I am converting my program to use a single paragraph as a universal write statement for a report.

Currently the code is write print-record from hold-area after top-of-page (using C01 statement).

Is it possible to use a variable for the advancing? I am doing this successfully with line numbers.

Basically, will this work the same as the following
move top-of- page to line-skip
write print-record after line-skip

write print-record after top-of-page


Also what should the line-skip variable be assigned as. I have as the following currently
01 line-skip   pic s9(07) comp-3 value +1.
Christy T.


Wherever you go, there you are - Buckaroo Banzai
ctrevino
 
Posts: 62
Joined: Tue Feb 23, 2010 1:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: Advancing with a variable

Postby MrSpock » Wed Sep 29, 2010 9:27 pm

As far as I can tell, you can specify a variables with an integer value for 'WRITE record AFTER/BEFORE ADVANCING', i.e.:

01 LINE-SKIP PIC 9(02) VALUE ZERO.
...
WRITE PRINT-RECORD AFTER ADVANCING LINE-SKIP.
...
MOVE 10 TO LINE-SKIP.
...
WRITE PRINT-RECORD AFTER ADVANCING LINE-SKIP.
...
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Advancing with a variable

Postby ctrevino » Tue Oct 05, 2010 9:31 pm

Thanks, Spock. :)
Christy T.


Wherever you go, there you are - Buckaroo Banzai
ctrevino
 
Posts: 62
Joined: Tue Feb 23, 2010 1:23 am
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post