View previous topic :: View next topic
|
Author |
Message |
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi ,
Can anyone help me to replace a particular column from one file to another file .
My input file contains two columns
For eg:
37654482938 20093103
And i want to replace this date in the output file having so many columns
also include 37654482938 20093004 |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Gay,
Quote: |
Can anyone help me to replace a particular column from one file to another file . |
Yes, In case you provide us all the details.
Quote: |
My input file contains two columns
For eg:
37654482938 20093103
And i want to replace this date in the output file having so many columns
also include 37654482938 20093004 |
What sort product are u using?
What is the condition for find (what to be replaced) and replace ?
How many records are there in the input file? |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi ,
There are totally some 20,000 records in the input file . Out of that i want to replace some 1000 records(only the date fields alone ) |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Hi Gay251319,
Do you think you have answered all below question of Aaru?
Aaru wrote: |
What sort product are u using?
What is the condition for find (what to be replaced) and replace ?
How many records are there in the input file?
|
Also Show us sample set of record and expected output for the same. |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi ,
Actually I am using this command
JOINKEYS FILES=F1,FIELDS=(12,11,A)
JOINKEYS FILES=F2,FIELDS=(12,11,A)
REFORMAT FIELDS=(F2:1,250,F2:256,45,F1:251:5)
SORT FIELDS=COPY
OUTREC BUILD=(1,300)
But its giving syntax error .
Comparing the 2 input files File 1: 37654482938 20093004
File 2 : 37654482938 20093103
If the card member is same i want to replace the date from the first file to the date in the present in the second file other fields should remain the same as in the second file
This is the output i needed |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But its giving syntax error . |
And there is some reason you did not post the diagnostic information including the error message id?
Do not post "it didn't work" - this is a complete waste of everyone's time. |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi ,
The thing is that
The total record length is 300
But the records exists till 256 in the input files
So if i am Reformatting the fields for the whole LREC=300 its not working
If i use
JOINKEYS FILES=F1,FIELDS=(12,11,A)
JOINKEYS FILES=F2,FIELDS=(12,11,A)
REFORMAT FIELDS=(F2:1,250,F1:251:5)
SORT FIELDS=COPY
OUTREC BUILD=(1,256)
Its working fine ...
I got the output now
Thanks a lot
Can u say the reason for this |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Gay,
Quote: |
Can u say the reason for this |
You had mentioned that u got a "syntax error" but failed to post the error message.
Learn to post the error message as it helps in saving time. |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi ,
Sorry
From next time onwards I will post the errors
Now i solved it
It is just a syntax error |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi all,
Thanks A lot For everyone who spend theie valuable time for me |
|
Back to top |
|
|
|