IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting 0s and hyphens while printing records in a PS file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Tue Jun 24, 2008 6:43 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top