Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to replace a particular column from one file to another

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to replace a particular column from one file to another
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: 1288
Location: Chennai, India

PostPosted: Mon Jun 22, 2009 12:09 pm    Post subject: Reply to: How to replace a particular column from one file
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    Post subject: Reply to: How to replace a particular column from one file
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Jun 22, 2009 7:20 pm    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Jun 23, 2009 9:37 am    Post subject: Reply to: How to replace a particular column from one file
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us