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
 

 

Syncsort Requirement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort Requirement
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: 2276
Location: @my desk

PostPosted: Tue Aug 11, 2009 5:48 pm    Post subject:
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    Post subject: Reply to: Syncsort Requirement
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: 2276
Location: @my desk

PostPosted: Tue Aug 11, 2009 7:10 pm    Post subject:
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    Post subject: Reply to: Syncsort Requirement
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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