IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

New to icetools and struggling with the sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
zaphany

New User


Joined: 16 May 2006
Posts: 11

PostPosted: Tue May 16, 2006 11:38 am
Reply with quote

Dear all, I am new to icetools and struggling with the sort of the following, please help!

File 1 :
field1 pic9(9)
field2 pic9(8)

12345678933333333
12345678988888888
12345678999999999
23456788811111111
34567890133464646

File 2 :
field1 pic9(9)
field2 pic9(10)
0101010101313131313
1234567891313131311
1234567893313113131
3456789011213311111

Expected result
Try to merge File1 & File 2 based on File 1 if field1 matches
123456789333333331313131311
123456789333333333313113131
123456789888888881313131311
123456789888888883313113131
123456789999999991313131311
123456789999999993313113131
345678901334646461213311111

Thanks in advance
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue May 16, 2006 1:56 pm
Reply with quote

Hi,

Please find the link for the one you are looking

www-03.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst02.html#t3a

regards
jai
Back to top
View user's profile Send private message
zaphany

New User


Joined: 16 May 2006
Posts: 11

PostPosted: Tue May 16, 2006 2:29 pm
Reply with quote

Thanks Jai, i did read this example and tried, but the case I am facing is that field1 in both files can appear more than once and I am trying to get all the combinations...
please help...
icon_sad.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 16, 2006 8:12 pm
Reply with quote

zaphany,

You're trying to do a cartesian join. SPLICE can't do that.
Back to top
View user's profile Send private message
zaphany

New User


Joined: 16 May 2006
Posts: 11

PostPosted: Wed May 17, 2006 11:29 am
Reply with quote

Thanks Frank! looks like i need to write programs for that...
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 25, 2009 4:28 am
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), you can now do a Cartesian join with JOINKEYS. For your example, you could use a DFSORT job like this:

Code:
 
//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//FILE1 DD *
12345678933333333
12345678988888888
12345678999999999
23456788811111111
34567890133464646
//FILE2 DD *
cccccccccdddddddddd
0101010101313131313
1234567891313131311
1234567893313113131
3456789011213311111
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  JOINKEYS F1=FILE1,FIELDS=(1,9,A),SORTED
  JOINKEYS F2=FILE2,FIELDS=(1,9,A),SORTED
  REFORMAT FIELDS=(F1:1,17,F2:13,10)
  OPTION COPY
/*



For complete details on JOINKEYS and the other new functions available with the Nov, 2009 DFSORT PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top