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

split datasets by field value


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

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Fri Jul 22, 2011 5:01 am
Reply with quote

I have two datasets:

First :
aaaa 124
bbbb 138
cccc 100

Second
aaaa 100
bbbb 140
cccc 100

is it possible to compare them and split it on to 3 datasets by digital values 1 where value less in the first file, 2 value is more than in first file, 3 value is equal

1st bbbb
2nd aaaa
3rd cccc
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 22, 2011 9:45 am
Reply with quote

can you have dups in either file1 or file2?
dups of the 4 char alpha in columns 1 thru 4

and are there always
  • 4 char alpha
  • 1 char space
  • 3 char numeric


and what is the record length and type (F or V) for both files?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Jul 22, 2011 11:09 am
Reply with quote

And have you examined the numerous examples on the forum?
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Fri Jul 22, 2011 5:06 pm
Reply with quote

there is no dups in both files... this is just sample, not real file - I need just idea... and yes, I've tried to find answer in the forum, no luck
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Fri Jul 22, 2011 6:39 pm
Reply with quote

anatol,
Because you haven't responded to all the questions asked, I am going to assume "few" things. In the REFORMAT, I am selecting entire record from from both the files but finally writting fields from first file only. While this can be changed,I also assumed 80 byte FB input files. I am creating 3 files, DMORE(Digital Value of file1 greater than file2), DLESS and DSAME.

See if below job works...
Code:
//STEP0001 EXEC PGM=SORT                                     
//SORTJNF1 DD *                                               
AAAA 124                                                     
BBBB 138                                                     
CCCC 100                                                     
//SORTJNF2 DD *                                               
AAAA 100                                                     
BBBB 140                                                     
CCCC 100                                                     
//SYSIN DD *                                                 
 JOINKEYS FILE=F1,FIELDS=(1,4,A)                             
 JOINKEYS FILE=F2,FIELDS=(1,4,A)                             
 REFORMAT FIELDS=(F1:1,80,F2:1,80)                           
 OPTION COPY                                                 
 OUTFIL FNAMES=DLESS,INCLUDE=(6,3,ZD,LT,86,3,ZD),BUILD=(1,80)
 OUTFIL FNAMES=DMORE,INCLUDE=(6,3,ZD,GT,86,3,ZD),BUILD=(1,80)
 OUTFIL FNAMES=DSAME,INCLUDE=(6,3,ZD,EQ,86,3,ZD),BUILD=(1,80)
/*                                                           
//DLESS    DD SYSOUT=*                                       
//DMORE    DD SYSOUT=*                                       
//DSAME    DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//SYSOUT   DD SYSOUT=*                                       

Thanks,
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Fri Jul 22, 2011 7:18 pm
Reply with quote

wow, thank you
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL/SORT to Split Records SYNCSORT 28
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
Search our Forums:

Back to Top