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
 

 

Values repeated more than Once

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Values repeated more than Once
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: 1703
Location: Australia

PostPosted: Fri Oct 03, 2008 6:40 am    Post subject:
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    Post subject: Reply to: Values repeated more than Once
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: 1703
Location: Australia

PostPosted: Fri Oct 03, 2008 10:30 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 03, 2008 11:27 am    Post subject:
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 Moderator


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

PostPosted: Fri Oct 03, 2008 8:34 pm    Post subject:
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    Post subject: Reply to: Values repeated more than Once
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 Moderator


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

PostPosted: Fri Oct 03, 2008 10:25 pm    Post subject:
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    Post subject: Reply to: Values repeated more than Once
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/


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    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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


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