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

How to replace a particular column from one file to another


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Mon Jun 22, 2009 12:05 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Jun 22, 2009 12:09 pm
Reply with quote

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
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Mon Jun 22, 2009 12:58 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Jun 22, 2009 1:01 pm
Reply with quote

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
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Mon Jun 22, 2009 1:47 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 22, 2009 7:20 pm
Reply with quote

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
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Mon Jun 22, 2009 7:47 pm
Reply with quote

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 icon_biggrin.gif


Can u say the reason for this
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jun 23, 2009 9:37 am
Reply with quote

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
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Tue Jun 23, 2009 10:38 am
Reply with quote

Hi ,

Sorry icon_sad.gif

From next time onwards I will post the errors
Now i solved it
It is just a syntax error
Back to top
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Tue Jun 23, 2009 10:39 am
Reply with quote

Hi all,

Thanks A lot For everyone who spend theie valuable time for me icon_sad.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top