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
 
Sort/Merge question

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort/Merge question
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 Moderator


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

PostPosted: Wed Apr 05, 2006 4:46 am    Post subject:
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    Post subject: Re: Sort/Merge question
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 Moderator


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

PostPosted: Wed Apr 05, 2006 9:03 pm    Post subject:
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    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 question about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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