Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

split datasets by field value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
anatol

Active User


Joined: 20 May 2010
Posts: 101
Location: canada

PostPosted: Fri Jul 22, 2011 5:01 am    Post subject: split datasets by field value
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    Post subject:
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: 1722
Location: UK

PostPosted: Fri Jul 22, 2011 11:09 am    Post subject:
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: 101
Location: canada

PostPosted: Fri Jul 22, 2011 5:06 pm    Post subject:
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: 578
Location: USA

PostPosted: Fri Jul 22, 2011 6:39 pm    Post subject:
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: 101
Location: canada

PostPosted: Fri Jul 22, 2011 7:18 pm    Post subject:
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    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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us