View previous topic :: View next topic
|
Author |
Message |
SSR Warnings : 1 New User
Joined: 26 Feb 2006 Posts: 38
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi SSR,
Value wont lost. Again u have to initialize it to move different record in it . |
|
Back to top |
|
|
vijay_bn79
New User
Joined: 20 Nov 2006 Posts: 48 Location: Hyderabad
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Sorry , this was the answer to an other question.
UmeySan |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
if the output file is double buffered or blocked, the data is gone. |
|
Back to top |
|
|
SSR Warnings : 1 New User
Joined: 26 Feb 2006 Posts: 38
|
|
|
|
Hi all,
thank you.
Regards
SSR |
|
Back to top |
|
|
|