Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Laterallly Merge Two Files using Sort

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

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Mon Jun 09, 2014 4:19 pm    Post subject: Laterallly Merge Two Files using Sort
Reply with quote

Hi,

I have the following requirement.

FB,LRECL=20
File 1 : YYYY1-MM1-DD1YYYY2-MM2-DD2
FB, LRECL=8
File 2 : YYYY3MM3DD3 (There is no hyphen unlike File1)

Output:
FB, LRECL=20
YYYY2-MM2-DD2YYYY3-MM3-DD3

Assumptions: 1. There are no common keys in the two input files.
2. Both the input files would have only 1 record respectively.
Thus Output also would be of 1 record.

Please advise.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


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

PostPosted: Tue Jun 10, 2014 8:00 pm    Post subject:
Reply with quote

Sourean,

Did you try JOINKEY's options? and that can be found below?

ftp://ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Tue Jun 10, 2014 8:18 pm    Post subject:
Reply with quote

Rohit,

As there are no common keys in between the two files doing a cartesian join won't bring the resultant output in a single row (Lateral Merge) I think.

I was trying with ICETOOL copy and sorting by SEQNUM also tried with SPLICE but not achieving the desired result.

May be bcoz some arguments which I'm mentioning in the TOOLIN are not correct.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Jun 10, 2014 8:37 pm    Post subject:
Reply with quote

This seems like a perfect use for a Rexx program.

A very small one in fact.

However, none of your LRECL and actual data match.
You would need to correct that in your requirement.

Quote:
FB,LRECL=20
File 1 : YYYY1-MM1-DD1YYYY2-MM2-DD2
FB, LRECL=8
File 2 : YYYY3MM3DD3 (There is no hyphen unlike File1)

Output:
FB, LRECL=20
YYYY2-MM2-DD2YYYY3-MM3-DD3
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Tue Jun 10, 2014 8:51 pm    Post subject:
Reply with quote

Souren,

did you see the page # 19 "Cartesian join"? it should work.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Jun 10, 2014 9:10 pm    Post subject:
Reply with quote

This is untested, but should work.

You will need Batch JCL to run this Rexx.

Code:
/* REXX */

"EXECIO 1 DISKR FILE1 (FINIS)"
PULL DATA1
DATE2 = SUBSTR(DATA1,11,10)

"EXECIO 1 DISKR FILE2 (FINIS)"
PULL DATA2
YYYY = SUBSTR(DATA2,1,4)
MM   = SUBSTR(DATA2,5,2)
DD   = SUBSTR(DATA2,7,2)

NEW_RECORD = DATE2||YYYY||'-'||MM||'-'||DD
DATAB.1 = NEW_RECORD
"EXECIO 1 DISKW FILE3 (STEM DATAB. FINIS)"

EXIT
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Jun 11, 2014 12:19 pm    Post subject: Reply to: Laterallly Merge Two Files using Sort
Reply with quote

If you don't have a key, you make one in the JNFnCNTL files. The same value, and then you have a match for JOINKEYS.

Fewer resources is to use the smaller file to generate a DFSORT Symbol on SYMNAMES in one small step, then a second step (equally small) to use the symbol generated to update the second file.
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us