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
 
Replacing record Based on matching strings in two different

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mrdinesh

New User


Joined: 23 Sep 2006
Posts: 24
Location: India

PostPosted: Thu Sep 25, 2014 8:22 pm    Post subject: Replacing record Based on matching strings in two different
Reply with quote

Hi,

I have a requirement where I have two files

File1
Code:

Header
Record1
Record2
Date 01/01/2013
Record3
Record4
Trailer


File2
Code:

Date 12/31/2014


My requirement is to replace the Date in the File1 with the Date in the File2.

I tried with Joinkeys to do the same as
Code:

SORT FIELDS=COPY                                                   
JOINKEYS FILE=SORTJNF1,FIELDS=(1,4,A)                             
JOINKEYS FILE=SORTJNF2,FIELDS=(1,4,A)                             
JOIN UNPAIRED                                                     
REFORMAT FIELDS=(F1:1,80,F2:1,80)                                 
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'DATE'),OVERLAY=(1:81,80,81:80X))
OUTREC FIELDS=(1:1,80)                           



But the output came in a sorted order, but I dont require the files to be sorted?

Is there any other way to do the same?


Thanks,
Dinesh
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2064
Location: NY,USA

PostPosted: Thu Sep 25, 2014 8:35 pm    Post subject:
Reply with quote

Dinesh, Have you looked this link?
http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.iceg200%2Fjoinrec.htm

Or try
FIELDS=(1,4,A),SORTED

Or a forum discussion,
http://ibmmainframes.com/about59864.html
Back to top
View user's profile Send private message
mrdinesh

New User


Joined: 23 Sep 2006
Posts: 24
Location: India

PostPosted: Thu Sep 25, 2014 8:51 pm    Post subject:
Reply with quote

Thanks Rohit...I was able to solve the issue..
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Sep 25, 2014 8:56 pm    Post subject: Reply to: Replacing record Based on matching strings in two
Reply with quote

No to JOINKEYS. It would be absurd to sort the data twice just to update one record.

Two-step process. First step takes the date-file and generates a symbol for a SYMNAMES dataset (ensure that records are 80 bytes).

Second step, which has DDnames for SYMNAMES using the file created and SYMNOUT going to SYSOUT, then a COPY operation with INREC IFTHEN=(WHEN=(logical expression) to identify the embedded date record and replace the value with the value from the symbol.

There are examples of the process if you search the forum for SYMNAMES, for instance.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Sep 25, 2014 8:57 pm    Post subject:
Reply with quote

mrdinesh wrote:
Thanks Rohit...I was able to solve the issue..


Remember, somewhere there is a Client paying for those resources.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2064
Location: NY,USA

PostPosted: Thu Sep 25, 2014 8:59 pm    Post subject:
Reply with quote

Bill, that helps. Thanks
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1567
Location: Andromeda Galaxy

PostPosted: Thu Sep 25, 2014 9:33 pm    Post subject:
Reply with quote

Bill,

Just checking,If file 2 is going to have last date of the year we could also use LASTDAYY correct?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Thu Sep 25, 2014 10:06 pm    Post subject: Reply to: Replacing record Based on matching strings in two
Reply with quote

If the answer required is always 31 December of the source year, then LASTDAYY would do it.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem with OVERLAY - BI on SMF Record Ghellar DFSORT/ICETOOL 4 Sat Dec 01, 2018 9:41 pm
No new posts Propagating value from nth record to ... ganasrinivasan DFSORT/ICETOOL 7 Fri Nov 30, 2018 8:31 am
No new posts Previous record x current record jackare SYNCSORT 1 Thu Nov 29, 2018 7:56 am
No new posts Process Last Key of a record based on... naveen katkuri DFSORT/ICETOOL 5 Mon Nov 12, 2018 9:54 am
This topic is locked: you cannot edit posts or make replies. Get value from 2nd record and PUSH it... ashokakash JCL & VSAM 1 Wed Oct 17, 2018 11:41 am

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