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
 
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am

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