Page 1 of 1

Advancing with a variable

PostPosted: Wed Sep 29, 2010 7:56 pm
by ctrevino
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.

Re: Advancing with a variable

PostPosted: Wed Sep 29, 2010 9:27 pm
by MrSpock
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.
...

Re: Advancing with a variable

PostPosted: Tue Oct 05, 2010 9:31 pm
by ctrevino
Thanks, Spock. :)