Page 3 of 3

Re: Select only paired records

PostPosted: Wed Jul 16, 2014 1:11 am
by NicC
venubhat

Please learn to use the code tags to present your code, data, JCL, control cards etc

Re: Select only paired records

PostPosted: Wed Jul 16, 2014 6:20 pm
by venubhat
ok...in the meanwhile, could anyone plz help me in resolving my issue...?? it's bit urgent.

Re: Select only paired records

PostPosted: Wed Jul 16, 2014 7:48 pm
by BillyBoyo
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))

Re: Select only paired records

PostPosted: Wed Jul 16, 2014 8:24 pm
by venubhat
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..

Re: Select only paired records

PostPosted: Wed Jul 16, 2014 9:06 pm
by Magesh23586
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

Re: Select only paired records

PostPosted: Fri Jul 18, 2014 2:47 pm
by venubhat
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