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
 

 

Removing the duplicay in a record

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

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Mon May 05, 2008 4:28 pm    Post subject: Removing the duplicay in a record
Reply with quote

Hi,

I have an input file
First six bytes is the key.
Each record has 10 other feilds each of 6 bytes which may have duplicate values. I want those fields to come only once along with the key.

With the follwing example we can understand easily

Input file:

AAAAAA 123454 893893 123454 123454 893893
BBBBBB 849749 839275 839275 839275
AAAAAB 849849 848948 849499 938484 949498 490047 894849
AAAAAC 199484 948593 985938 948593 489489 948593


Output:
AAAAAA 123454 893893
BBBBBB 849749 839275
AAAAAB 849849 848948 849499 938484 949498 490047 894849
AAAAAC 199484 948593 985938 489489
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Mon May 05, 2008 10:50 pm    Post subject:
Reply with quote

vvmanyam,

The following DFSORT JCL will give you the desired results


Code:

//STEP0100 EXEC PGM=ICEMAN                             
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
AAAAAA    123454893893123454123454893893               
BBBBBB    849749839275839275839275                     
AAAAAB    849849848948849499938484949498490047894849   
AAAAAC    199484948593985938948593489489948593         
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *   
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=(11,6,CH,EQ,17,6,CH),OVERLAY=(17:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,23,6,CH),OVERLAY=(23:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,29,6,CH),OVERLAY=(29:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,35,6,CH),OVERLAY=(35:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,41,6,CH),OVERLAY=(41:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,47,6,CH),OVERLAY=(47:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,53,6,CH),OVERLAY=(53:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(11,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,23,6,CH),OVERLAY=(23:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,29,6,CH),OVERLAY=(29:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,35,6,CH),OVERLAY=(35:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,41,6,CH),OVERLAY=(41:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,47,6,CH),OVERLAY=(47:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,53,6,CH),OVERLAY=(53:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(17,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(23,6,CH,EQ,29,6,CH),OVERLAY=(29:6X),HIT=NEXT),
        IFTHEN=(WHEN=(23,6,CH,EQ,35,6,CH),OVERLAY=(35:6X),HIT=NEXT),
        IFTHEN=(WHEN=(23,6,CH,EQ,41,6,CH),OVERLAY=(41:6X),HIT=NEXT),
        IFTHEN=(WHEN=(23,6,CH,EQ,47,6,CH),OVERLAY=(47:6X),HIT=NEXT),
        IFTHEN=(WHEN=(23,6,CH,EQ,53,6,CH),OVERLAY=(53:6X),HIT=NEXT),
        IFTHEN=(WHEN=(23,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(23,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(29,6,CH,EQ,35,6,CH),OVERLAY=(35:6X),HIT=NEXT),
        IFTHEN=(WHEN=(29,6,CH,EQ,41,6,CH),OVERLAY=(41:6X),HIT=NEXT),
        IFTHEN=(WHEN=(29,6,CH,EQ,47,6,CH),OVERLAY=(47:6X),HIT=NEXT),
        IFTHEN=(WHEN=(29,6,CH,EQ,53,6,CH),OVERLAY=(53:6X),HIT=NEXT),
        IFTHEN=(WHEN=(29,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(29,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(35,6,CH,EQ,41,6,CH),OVERLAY=(41:6X),HIT=NEXT),
        IFTHEN=(WHEN=(35,6,CH,EQ,47,6,CH),OVERLAY=(47:6X),HIT=NEXT),
        IFTHEN=(WHEN=(35,6,CH,EQ,53,6,CH),OVERLAY=(53:6X),HIT=NEXT),
        IFTHEN=(WHEN=(35,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(35,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(41,6,CH,EQ,47,6,CH),OVERLAY=(47:6X),HIT=NEXT),
        IFTHEN=(WHEN=(41,6,CH,EQ,53,6,CH),OVERLAY=(53:6X),HIT=NEXT),
        IFTHEN=(WHEN=(41,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(41,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(47,6,CH,EQ,53,6,CH),OVERLAY=(53:6X),HIT=NEXT),
        IFTHEN=(WHEN=(47,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(47,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(53,6,CH,EQ,59,6,CH),OVERLAY=(59:6X),HIT=NEXT),
        IFTHEN=(WHEN=(53,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT),
        IFTHEN=(WHEN=(59,6,CH,EQ,65,6,CH),OVERLAY=(65:6X),HIT=NEXT) 
/*


Hope this helps...

Cheers
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Tue May 06, 2008 11:06 am    Post subject: Reply to: Removing the duplicay in a record
Reply with quote

Thanks, for the solution
Is this the only way to achieve this logic in a jcl?
or any other simple method is there?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed May 07, 2008 2:56 am    Post subject: Re: Reply to: Removing the duplicay in a record
Reply with quote

vvmanyam wrote:
Thanks, for the solution
Is this the only way to achieve this logic in a jcl?


vvmanyam,

JCL is not a programming language cannot do any thing by itself. It is your PGMS or Utilities which are invoked by JCL that perform the functions. JCL does not do any data manipulation.

vvmanyam wrote:
or any other simple method is there?


Define Simple method.
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 Record Not found in AlX but record re... mukun264 COBOL Programming 6 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am


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