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
 

 

Splitting file and eliminating duplicates in a single step.

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

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue May 05, 2009 6:58 pm    Post subject: Splitting file and eliminating duplicates in a single step.
Reply with quote

I have a requirement.

First step
I need to split a file into file A and file B. File A should contain records with string X and file B with String Y

Second step
is to eliminate duplicates on File A based on a condition and then write the total at the end of the file

third step
is to eliminate duplicates from File B based on other condition and then write the total at the end of the file

Is it possible to combine all 3 steps in one?

I can share the sort cards i used for the different steps. let me know your thoughts.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue May 05, 2009 7:38 pm    Post subject:
Reply with quote

Quote:
Can you advise if this can be combined in 1 step?
I'd think so, what is the lrecl and recfm?
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue May 05, 2009 7:47 pm    Post subject: Reply to: Splitting file and eliminating duplicates in a sin
Reply with quote

All the 3 files are LRECL of 80 byte and RECFM of FB
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue May 05, 2009 8:07 pm    Post subject:
Reply with quote

If you added in your inrec a common area for the key that is different between the two types of records, then a single sort would be enough.
For the sum to work, you may need to add the type (AA or AB) to the sort key.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue May 05, 2009 8:58 pm    Post subject: Reply to: Splitting file and eliminating duplicates in a sin
Reply with quote

cjt,

use the following JCL. I assumed that your AA records have values at pos 32 that you want to sum and AB records have values at pos 67 that needs to be summed.

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input 80 bytes,DISP=SHR     
//FILEAA   DD SYSOUT=*                                         
//FILEAB   DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  INCLUDE COND=(30,2,SS,EQ,C'AA,AB')                           
                                                               
  INREC IFTHEN=(WHEN=(30,2,SS,EQ,C'AA'),OVERLAY=(81:32,9)),     
        IFTHEN=(WHEN=(30,2,SS,EQ,C'AB'),OVERLAY=(81:67,9))     
                                                               
  SORT FIELDS=(30,2,CH,A,13,11,CH,A,81,09,ZD,A)                 
                                                               
  OUTFIL FNAMES=FILEAA,INCLUDE=(30,2,CH,EQ,C'AA'),             
  BUILD=(1,31,81,09,ZD,M11,41,40),REMOVECC,                     
  TRAILER1=(10:'TOTAL AMOUNT',                                 
            40:TOTAL=(81,09,ZD,M5,LENGTH=20))                   
                                                               
  OUTFIL FNAMES=FILEAB,INCLUDE=(30,2,CH,EQ,C'AB'),             
  BUILD=(1,46,47,13,ZD,M11,60,7,81,09,ZD,M11,76,5),REMOVECC,   
  TRAILER1=(10:'TOTAL AMOUNT',                                 
            40:TOTAL=(81,09,ZD,M5,LENGTH=20))                   
/*
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Wed May 06, 2009 2:29 pm    Post subject:
Reply with quote

Thanks a million Kolusu for your time as well. the method specified by you is working for me.

I have one question. please bear with me.

What does 'SS' stand for in the statement

INCLUDE COND=(30,2,SS,EQ,C'AA,AB')
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed May 06, 2009 2:43 pm    Post subject:
Reply with quote

SS, 3.7.4.1
See also substring comparison operator
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Wed May 06, 2009 3:08 pm    Post subject:
Reply with quote

thanks for the info CICS guy
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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 4 Mon Mar 27, 2017 3:59 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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