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: 6967
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: 1788
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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm


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