IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Values repeated more than Once


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Oct 03, 2008 5:29 am
Reply with quote

Hi,

My input file looks like this

Policy1 USA
Policy1 CANADA
Policy1 MEXICO
Policy2 USA

What I need to do is, if the feild 1 ( in this case Policy1 & Policy2) is repeated more that once, then I need to write it in another file.
Note that Policy2 is not repeated,hence it should not be written.

Hence, My output file should look like this

Policy1 USA
Policy1 CANADA
Policy1 MEXICO

Note that SUM FEILDS=NONE and XSUM wont work here.

The file is 80 bytes long. Feild 1 starts from position 1 and feild 2 from 10.

Please advise.

Thanks,
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Oct 03, 2008 6:40 am
Reply with quote

Hi,

try this
Code:
//ALLDUPS  EXEC  PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD *                                           
POLICY1 USA                                               
POLICY1 CANADA                                             
POLICY1 MEXICO                                             
POLICY2 USA                                               
/*                                                         
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
SELECT FROM(IN) TO(OUT) ON(1,7,CH) ALLDUPS                 
/*                                                         



Gerry
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Oct 03, 2008 9:08 am
Reply with quote

Thanks Gerry, It does work. But we are not allowed to use ICETOOL in production. ICEMAN is allowed though.
Any other solutions please ?

Thanks
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Oct 03, 2008 10:30 am
Reply with quote

Hi,

here is another way, I'm sure someone will come up with something different
Code:
//S1       EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                       
POLICY1 USA                                                           
POLICY1 CANADA                                                         
POLICY1 MEXICO                                                         
POLICY2 USA                                                           
/*                                                                     
//SORTOUT DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)       
//SYSIN   DD *                                                         
  INREC OVERLAY=(81:C'00000001')                                       
  SORT FIELDS=(1,07,CH,A)                                             
  SUM FIELDS=(81,8,ZD)                                                 
  OUTFIL INCLUDE=(81,8,ZD,GT,+1),                                     
  BUILD=(1,80)                                                         
/*                                                                     
//S2       EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=&&T1,DISP=(SHR)               
//         DD *                                 
POLICY1 USA                                     
POLICY1 CANADA                                 
POLICY1 MEXICO                                 
POLICY2 USA                                     
/*                                             
//SORTOUT DD SYSOUT=*                           
//SYSIN   DD *                                 
  OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,7))
  SORT FIELDS=(1,07,CH,A)                       
  OUTFIL INCLUDE=(81,8,ZD,GT,+1)               
/*                                             



Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Oct 03, 2008 11:27 am
Reply with quote

Quote:
But we are not allowed to use ICETOOL in production.

Who on earth comes up with these stupid restrictions ?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 03, 2008 8:34 pm
Reply with quote

ICETOOL has been part of DFSORT since 1991! It's fully documented and supported. It's ridiculous for a shop not to allow it in production.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Oct 03, 2008 9:32 pm
Reply with quote

Unfortunately, that is the case here. They dont allow us to move ICETOOL in prod.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 03, 2008 10:25 pm
Reply with quote

Just out of curiosity, have they ever given you a reason why? Do they realize they're paying for functionality that they're not letting you take advantage of?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 03, 2008 11:22 pm
Reply with quote

ap_mainframes,

The following DFSORT JCL will give you the desired results.The job uses DFSORT's new WHEN=GROUP functions available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008).

If you don't have z/OS DFSORT PTF UK90013, ask your System Programmer to install it (it's free).

For complete details on the new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links


Code:

//STEP0100 EXEC PGM=ICEMAN                           
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                     
POLICY1   USA                                       
POLICY1   CANADA                                     
POLICY1   MEXICO                                     
POLICY2   USA                                       
POLICY3   USA                                       
POLICY3   CANADA                                     
POLICY4   PICK1                                     
POLICY4   PICK2                                     
POLICY4   PICK3                                     
POLICY4   PICK4                                     
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  OPTION EQUALS                                     
  SORT FIELDS=(1,9,CH,A)                             
  OUTREC IFTHEN=(WHEN=INIT,                         
  OVERLAY=(81:1,80,SEQNUM,3,ZD,RESTART=(1,9))),     
  IFTHEN=(WHEN=GROUP,BEGIN=(161,3,ZD,EQ,1),RECORDS=2,
  PUSH=(81:81,80))                                   
                                                     
  OUTFIL IFOUTLEN=80,INCLUDE=(161,3,ZD,GE,2),       
  IFTHEN=(WHEN=(161,3,ZD,EQ,2),BUILD=(81,80,/,1,80))
/*                                                   


The output from this job is

Code:

POLICY1   USA     
POLICY1   CANADA 
POLICY1   MEXICO 
POLICY3   USA     
POLICY3   CANADA 
POLICY4   PICK1   
POLICY4   PICK2   
POLICY4   PICK3   
POLICY4   PICK4   
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
Search our Forums:

Back to Top