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
 
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: 1788
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: 683
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: 1788
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: 683
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: 7315

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 Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 5 Fri Sep 22, 2017 6:00 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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