IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort Requirement


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Aug 11, 2009 3:53 pm
Reply with quote

Hi,

My input file,

Code:

DRGDU600 X           
DRGDU700   X         
DRGDU700     X       
DRGDU600 X           
DRGDU600   X         
DRGDU800   X         


Required output:
Code:

DRGDU600 X X     
DRGDU700   X X   
DRGDU800   X     


I tried following JCL, but it wont work fine.
Code:

//IN1 DD DSN=DEV2.RK.TEST.REC80,DISP=SHR                     
//OUT  DD DSN=DEV2.RK.TEST.REC80.US,DISP=SHR                 
//TOOLIN   DD *                                             
 SPLICE FROM(IN1) TO(OUT) ON(1,8,CH) WITHEACH WITH(10,1) -   
  WITH(12,1) WITH(14,1)                                     
/*                                                           
//*                                                         


O/p I got:
Code:

DRGDU600 X X 
DRGDU700   X 


Please let me know how to achieve this requirement.

Thanks in advance
R KARTHIK
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Aug 11, 2009 5:48 pm
Reply with quote

Is this a business requirement? What does 'X' represent here?

Out of the below duplicates, which value you want in output?
Code:
DRGDU600 X
DRGDU600 X
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Aug 11, 2009 6:17 pm
Reply with quote

Hi,

X represents a field is present or not.

So we can select any duplicates. No condition in that.

Regards
R KARTHIK
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Aug 11, 2009 7:10 pm
Reply with quote

Karthik,

Here's a SyncSort job which does the same. I have assumed FB files of LRECL=80.
Code:
//STEP1  EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN= Input  file (FB/80)                           
//SORTOUT  DD DSN= Output file (FB/80)                           
//SYSIN    DD *                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'000')),                 
        IFTHEN=(WHEN=(10,1,CH,EQ,C'X'),OVERLAY=(81:C'1')),       
        IFTHEN=(WHEN=(12,1,CH,EQ,C'X'),OVERLAY=(82:C'1')),       
        IFTHEN=(WHEN=(14,1,CH,EQ,C'X'),OVERLAY=(83:C'1'))       
  SORT FIELDS=(1,8,CH,A)                                         
  SUM  FIELDS=(81,1,ZD,82,1,ZD,83,1,ZD)                         
  OUTFIL IFOUTLEN=80,                                           
         IFTHEN=(WHEN=(81,1,ZD,GT,0),OVERLAY=(10:C'X'),HIT=NEXT),
         IFTHEN=(WHEN=(82,1,ZD,GT,0),OVERLAY=(12:C'X'),HIT=NEXT),
         IFTHEN=(WHEN=(83,1,ZD,GT,0),OVERLAY=(14:C'X')) 
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Aug 11, 2009 7:26 pm
Reply with quote

Hey Arun,

Thank u very much. It is working fine. icon_biggrin.gif

Regards
R KARTHIK
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top