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: 1883
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: 710
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: 1883
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: 710
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: 7314

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 two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am

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