Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Need to replicate a line (for ex) in a input file
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: 1187
Location: Bangalore,India

PostPosted: Mon Nov 20, 2006 3:03 pm    Post subject:
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    Post subject:
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: 755
Location: Germany

PostPosted: Mon Nov 20, 2006 3:37 pm    Post subject:
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: 755
Location: Germany

PostPosted: Mon Nov 20, 2006 3:39 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Nov 20, 2006 5:37 pm    Post subject: Re: Need to replicate a line (for ex) in a input file
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    Post subject: Thank you
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us