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

Need to replicate a line (for ex) in a input file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SSR
Warnings : 1

New User


Joined: 26 Feb 2006
Posts: 38

PostPosted: Mon Nov 20, 2006 2:57 pm
Reply with quote

Hi,

I need to replicate a line (for ex) in a input file make some changes to second line and write both the lines to output file.


Input file
xxxxxxxx yyyyyyyy zzzzzzzz

Output File:
xxxxxxxx yyyyyyyy zzzzzzzz
xxxxxxxx yyyyyy12 zzzzzz34

That is the first row has the same value and the second row with a different one.

Read file into IN-REC.
MOVE IN-REC TO OUT-REC.
WRITE OUT-REC.
MOVE ?12? TO INREC(16:2)
MOVE ?34? TO INREC(X:Y)
WRITE OUT-REC.

My question is :

When we write OUT-REC ONCE will the value be lost again do we need to move the value from IN_REC?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Nov 20, 2006 3:03 pm
Reply with quote

Hi SSR,

Value wont lost. Again u have to initialize it to move different record in it .
Back to top
View user's profile Send private message
vijay_bn79

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Mon Nov 20, 2006 3:14 pm
Reply with quote

Hi..,

yes.., Guptae is correct..., value wont lost unless you moved other value to out-rec or initialize that out-rec


Thanks
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Nov 20, 2006 3:37 pm
Reply with quote

Hi !

By reading both files in a matching-record-key function, you have always
three conditions to handel.

File-1-Key = File-2-Key ...do something then read both files
File-1-Key > File-2-Key ...read file-2 compare again
File-1-Key < File-2-Key ...read file-1 compare again

Regards, UmeySan
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Nov 20, 2006 3:39 pm
Reply with quote

Sorry , this was the answer to an other question.
UmeySan
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Nov 20, 2006 5:37 pm
Reply with quote

if the output file is double buffered or blocked, the data is gone.
Back to top
View user's profile Send private message
SSR
Warnings : 1

New User


Joined: 26 Feb 2006
Posts: 38

PostPosted: Mon Nov 20, 2006 5:39 pm
Reply with quote

Hi all,

thank you.

Regards
SSR
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top