Select only paired records



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Select only paired records

Postby NicC » Wed Jul 16, 2014 1:11 am

venubhat

Please learn to use the code tags to present your code, data, JCL, control cards etc
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Re: Select only paired records

 

Re: Select only paired records

Postby venubhat » Wed Jul 16, 2014 6:20 pm

ok...in the meanwhile, could anyone plz help me in resolving my issue...?? it's bit urgent.
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Select only paired records

Postby BillyBoyo » Wed Jul 16, 2014 7:48 pm

With your existing code, you have a single record getting past the INCLUDE= of the OUTFIL. That single record has the combined records on. You just need to amend the INCLUDE= (or make it OMIT= if it is clearer) so that if you have that situation that record is not presented to the OUTFIL.
OMIT=(postion1,lenght1,CH,EQ,C'value1',AND,(postion2,lenght2,CH,EQ,C'value2',
     OR,(reverse of your existing condition))
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Select only paired records

Postby venubhat » Wed Jul 16, 2014 8:24 pm

i/p
20006 ADMIN
20007 USER
20008 CUSTOMER
20006 AUTH
20009 ADMIN

o/p
20006 ADMIN
20006 AUTH

I want only records that have both ADMIN & USER. will it work with the code you provided Billy...?? just wanted to confrim..
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Select only paired records

Postby Magesh23586 » Wed Jul 16, 2014 9:06 pm

Try this and let us know the results.

I assume you will not have Admin/Auth twice for a same Key.
Also if you have admin,Auth and user or etc this program will generate Admin and Auth alone in the output excluding user.

//CPYJK EXEC PGM=ICETOOL                                     
//TOOLMSG DD SYSOUT=*                                       
//SYSOUT DD SYSOUT=*                                         
//DFSMSG DD SYSOUT=*                                         
//IN1 DD *                                                   
20006 ADMIN                                                 
20007 USER                                                   
20008 CUSTOMER                                               
20006 AUTH                                                   
20009 ADMIN                                                 
//OUT2 DD SYSOUT=*                                           
//TOOLIN DD *                                               
  SELECT FROM(IN1) TO(OUT2) ON(1,5,CH) ALLDUPS USING(CNT1)   
/*                                                           
//CNT1CNTL DD *                                             
  INCLUDE COND=(7,5,CH,EQ,C'ADMIN',OR,7,4,CH,EQ,C'AUTH')     


Thanks
Magesh
Magesh23586
 
Posts: 35
Joined: Sat Jul 05, 2014 5:36 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Select only paired records

Postby venubhat » Fri Jul 18, 2014 2:47 pm

hi magesh

its working...thanks a lot...thank u all who helped me in resolving this...i must say, you guys are great and a great forum.

thanks
venu
venubhat
 
Posts: 14
Joined: Mon Jul 14, 2014 4:04 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post