Problem with WRITE AFTER ADVANCING



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

Re: Problem with WRITE AFTER ADVANCING

Postby Robert Sample » Thu Jun 23, 2011 7:33 am

However, the report showed that the second line is not blank but continue print the second Heading even when I change the number of line to 2.
Did you actually print the report, or did you just look at it online?
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Problem with WRITE AFTER ADVANCING

Postby ang » Thu Jun 23, 2011 7:45 am

Hi Robert,

I used Browse command in TSO to view the report.

Thanks.
ang
 
Posts: 7
Joined: Wed Jun 22, 2011 12:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Problem with WRITE AFTER ADVANCING

Postby Robert Sample » Thu Jun 23, 2011 7:55 am

Are you aware that a report will NOT show blank lines when browsing in TSO as compared to actually printing it? The carriage control character in the first position will not be interpreted to show a blank line while browsing -- but when the report is printed, the carriage control character will take effect.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Problem with WRITE AFTER ADVANCING

Postby ang » Thu Jun 23, 2011 8:03 am

I am not sure whether the first character will be analyzed or not in Browse mode, sorry about that. But what actually confusing me is why when I use BEFORE clause, the blank line will be shown even though not in the right format?

Thanks.
ang
 
Posts: 7
Joined: Wed Jun 22, 2011 12:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Problem with WRITE AFTER ADVANCING

Postby BillyBoyo » Thu Jun 23, 2011 11:34 am

ang, change your recfm to FBA please. You can check in the JCL manual, but this is for an ANSI printer control character file. When you browse the output you should now see the characters enrico wrote of yesterday,
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Problem with WRITE AFTER ADVANCING

Postby Ed Goodman » Fri Jun 24, 2011 1:12 am

Show us the output, including that first column. I'd bet lunch there is a '-' in column one of line two.

The before/after confusion will make total sense if you think about how they work...just remember that the COBOL program has to work one line at a time. So if you ask it to "put this line out, then make a blank line after it", it will write out a line, then write out a blank line so that the next record won't go there. Remember that it CAN NOT ASSUME what the next record will be.
On the other hand, if you say, "Make a blank line, then write this record", COBOL will know that it can tell the printer to skip a line by putting the '-' in column one, so it puts the data in that line too.

Now, when you LOOK at it online, you see blanks using BEFORE, but no blanks using AFTER. However, if you use your new knowledge to realize that the '-' in column 1 makes magical things happen during printing, you'll see that they will look the same once printed.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Problem with WRITE AFTER ADVANCING

Postby ang » Mon Jun 27, 2011 9:31 am

Using BEFORE clause:


Using AFTER clause:


Hmm...seems nothing in the first column...

All of the blue crud has been deleted. If you post info from a screen, use copy/paste and the Code tag.
ang
 
Posts: 7
Joined: Wed Jun 22, 2011 12:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Problem with WRITE AFTER ADVANCING

Postby BillyBoyo » Mon Jun 27, 2011 11:03 am

Please don't post images, but copy/paste from your emulator if possible. Don't chop off the screen, so we can be sure of what you are using.

Still no sign of your JCL.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Problem with WRITE AFTER ADVANCING

Postby Ed Goodman » Tue Jun 28, 2011 8:53 pm

Are you aware of the "DISPLAY CC" command in tso? In BROWSE mode, type "DISPLAY CC" and it will show you what's really in column 1.

"DISPLAY NOCC" will hide that column.

If you're not seeing ANYTHING in column 1, then I'm guessing that you have "DISPLAY NOCC" active.

Sorry I didn't get to see your earlier screen prints, that probably would have told me for sure.

One thing I CAN tell you is that it's probably working the way it's supposed to, and you are getting the correct results. It's just a matter of getting you to be able to see and understand it.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Problem with WRITE AFTER ADVANCING

Postby dick scherrer » Tue Jun 28, 2011 11:44 pm

Hi Ed,

Sorry I didn't get to see your earlier screen prints, that probably would have told me for sure.
Unfortunately what was posted was your basically unreadable IBM 3270 terminal blue. . . on a black background. No carriage control shown "before" or "after".

It would be so easy for ts to simply copy/paste and use the "Code" tag, but as you see, this is not happening. . .

It's just a matter of getting you to be able to see and understand it.
Yup, we'll see. . .

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

PreviousNext

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post