Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with: BEFORE ADVANCING PAGE! Help needed... 1

Status
Not open for further replies.

A123I

Programmer
Oct 15, 2003
8
0
0
US
Hi folks,
I am working on the VS COBOL-II. I had coded a new program in which there was a requirement of using the BEFORE ADVANCING PAGE with one of the WRITE statement out of 24 WRITE statements. When I'm using BEFORE ADV.. all the writes are being written preceded by the blank line and the format of my output file changes from FB 132 to FBM 133. And just to be sure that the problem is coming out of the BEFORE ADVANCING PAGE statement I changed this to AFTER ADVANCING PAGE. And the things worked as expected with no blank preceding in other write statements and the page break at required position and the file format changed from FB 132 FBA 133, which was expected because of the control chracters being inserted.

Please let me know if you need any other information regarding this.

thanks and regards,
Atul
 
The difference you are experiencing is the difference between using ASA print-control characters (FBA) and Machine print-control codes (FBM). FBA only supports spacing and channel skips on a printer prior to printing a line. In order to handle spacing and channel skipping after a printed line, Cobol uses FBM.

The two modes of writing to a printer are dictated by the Before or After command. In order for Cobol in the IBM world to accomplish what you are asking, the results are as you described. When using FBM, many times the Blank line is used to house the machine code for skip to channel xx on a printer. In order to get the printer to skip to page (channel 1 usually) after you print a line requires a blank line to be printed with the control character embedded in it commanding the printer to advance to the channel 1 position. That is where the blank line comes from.

I am not aware of any way to override this. Someone may know of a way however, most people I know just get use to it in the IBM world.

etom
 
If the "logic" of your program is such, it is often (not always) possible to switch from BEFORE ADVANCING to AFTER ADVANCING by simply "changing" where the statement is placed.

For example, if you are using BEFORE ADVANCING on a "page footer" - you might be able to change to an AFTER ADVANCING on your page headers.

As far as 132 vs 133 LRECL, you should check out the ADV compiler option.

Bill Klein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top