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

Sort/Merge question


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

New User


Joined: 05 Apr 2006
Posts: 6

PostPosted: Wed Apr 05, 2006 3:31 am
Reply with quote

Hello, I have two input files. the first is a master and the second is an alternate. The alternate file can have any number of duplicate records. I need to sort them by the first 10 bytes then merge them.

IN1 = FB, 372bytes
IN2 = FB, 360bytes

key in both files 1:10 bytes

In the master file (IN1), there is data in bytes 360:12 which should be copied to all duplicate records in IN2.

For example.

IN1
0000000001....IND <--- in bytes 360:12
0000000002....-0-
0000000003....IND

IN2
0000000001
0000000001
0000000001
0000000002

DESIRED OUTPUT
0000000001....IND
0000000001....IND
0000000001....IND
0000000001....IND
0000000002....-0-
0000000002....-0-
0000000003....IND


My question is this: How can I sort/merge the two files so that the desired output is obtained? I tried icetool/splice but was unsuccessful.

Any suggestions??

Thanks!
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 Apr 05, 2006 4:46 am
Reply with quote

Quote:
I tried icetool/splice but was unsuccessful.


I don't know what you tried so I can't tell you what you did wrong.

However, here's a DFSORT/ICETOOL job using SPLICE that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN2 DD DSN=...  input file2 (FB/360)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=...  input file1 (FB/372)
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD DSN=...  output file (FB/372)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
SPLICE FROM(CON) TO(OUT) ON(1,10,CH) WITHALL WITH(1,360) -
  KEEPNODUPS KEEPBASE
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,360,372:X)
/*
Back to top
View user's profile Send private message
skodidine

New User


Joined: 05 Apr 2006
Posts: 6

PostPosted: Wed Apr 05, 2006 8:57 pm
Reply with quote

Thanks Frank. It worked great. Comparing your icetool/splice with what I had, i see the folly of my ways. I was using the 372byte file first and trying to splice that with the 360byte. I see why you have the 360 first.

Once again, thank you!

Sanjay
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 Apr 05, 2006 9:03 pm
Reply with quote

That's a common mistake. Glad I could help.
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top