Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Getting 0s and hyphens while printing records in a PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Tue Jun 24, 2008 5:15 pm    Post subject: Getting 0s and hyphens while printing records in a PS file
Reply with quote

HI,
I wrote a COBOL program to read the records from two input files and write into one output file. While printing the records in the output file i am getting zeros and hyphens suffixed with the output records. I tried to move spaces before writing the records,but it is not working.i have attached my output with this query.

Thanks.[/b]
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 24, 2008 5:17 pm    Post subject:
Reply with quote

Printer spacing control characters.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Tue Jun 24, 2008 5:31 pm    Post subject:
Reply with quote

can you please tell me how can i remove those characters from my output file?

Thanks,
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 24, 2008 5:33 pm    Post subject:
Reply with quote

Use WRITE not WRITE AFTER ADVANCING.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Tue Jun 24, 2008 5:41 pm    Post subject:
Reply with quote

ya. thats what i have used for writing each record. Is it like i have to use a minimum of no. of lines of gap between each record ? Actually every line that was displayed in my output, i have declared that as a group variable in the file descriptor section for the output file. I will just move values to the respective group variables and print the records using WRITE AFTER ADVANCING 2 LINES or 5 LINES. am i more sound like confusing ? icon_sad.gif
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Tue Jun 24, 2008 5:46 pm    Post subject:
Reply with quote

Sorry i misread your answer craq. I am just opening my output file and writing into output file by moving values to the respective group variables and then i am closing it. If i use write alone , cant the records get overwritten?
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Tue Jun 24, 2008 5:52 pm    Post subject:
Reply with quote

Thank you very much Craq. I got the required output. icon_biggrin.gif
Can you please tell me what is the difference between write and write after advancing? and when i should use the latter?


Thanks,
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 24, 2008 6:32 pm    Post subject:
Reply with quote

WRITE is for data files, WRITE AFTER ADVANCING is for reports.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jun 24, 2008 6:43 pm    Post subject:
Reply with quote

WRITE AFTER ADVANCING adds carriage control characters to your output file since the presumption is that you're printing: space for single space, 0 for double space, - for triple space, 1 for top of page, etc.

WRITE doesn't add carriage control characters.

In both cases, since the output buffer is cleared before the next COBOL statement is encountered, there is no chance of overwriting data -- unless you're running two programs that write to the same file at the same time without using a mechanism such as enqueue.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us