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
 
How to set condition code to '04' if there are duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sangee27

New User


Joined: 16 Mar 2007
Posts: 19
Location: Pune

PostPosted: Wed May 16, 2007 4:47 pm    Post subject: How to set condition code to '04' if there are duplicates
Reply with quote

Hi,

I have an input file of record length 900. My requirement is , i have to check for any duplicate records, based on the entire record.
If duplicate records are present i have to write that to a file and set a condition code of '04' so that an email will be sent regarding the duplicates.

I have used the following jcl:
Code:

//STPU100 EXEC PGM=ICETOOL                               
//TOOLMSG   DD SYSOUT=*                                 
//DFSMSG    DD SYSOUT=*                                 
//INFILE1   DD DSN=filename
//NODUPS1   DD DSN=outfile       
//DUPS1     DD DSN=dupfile           
//TOOLIN    DD *                                         
SELECT FROM(INFILE1) TO(DUPS1) ON(1,900,CH) FIRSTDUP DISCARD(NODUPS1)

and writing the dupicates to the dups1 file.

Now could you please tell me how to proceed with setting condition code to 04 if there are duplicates.
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: Wed May 16, 2007 8:40 pm    Post subject:
Reply with quote

Add the following DFSORT/ICETOOL operator after SELECT:

COUNT FROM(DUPS1) NOTEMPTY RC4

Note that you don't need DISCARD(NODUPS1) in the SELECT statement unless you want to keep the records that aren't written to DUPS1 for some reason.
Back to top
View user's profile Send private message
sangee27

New User


Joined: 16 Mar 2007
Posts: 19
Location: Pune

PostPosted: Thu May 17, 2007 10:33 am    Post subject:
Reply with quote

Thanks a lot Frank.

And regarding your note, yes i want to process those records which were not written to DUPS1 file.
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 Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am

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