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
 
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: 111
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: 6968
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: 1894
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: 111
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: 111
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm

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