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
 
Get first 2 records using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 59
Location: Makati City, Philippines

PostPosted: Thu Jan 29, 2009 12:33 pm    Post subject: Get first 2 records using SYNCSORT
Reply with quote

Hello,

How do i accomplish this using SYNCSORT?

Sample data:

XXX AAA AAA AAA
XXX AAA AAA AAA
XXX AAA AAA AAA
XXX BBB BBB BBB
XXX BBB BBB BBB
XXX BBB BBB BBB
XXX CCC CCC CCC
XXX DDD DDD DDD

OUTPUT Should be:
XXX AAA AAA AAA
XXX AAA AAA AAA
XXX BBB BBB BBB
XXX BBB BBB BBB
XXX CCC CCC CCC
XXX DDD DDD DDD

An identical record should only appear twice in the output file.

Thanks!
Back to top
View user's profile Send private message

Arun Raj

Moderator


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

PostPosted: Thu Jan 29, 2009 1:12 pm    Post subject:
Reply with quote

sprikitik,

Try this.
Code:
.//STEP1    EXEC PGM=SORT                       
//SYSOUT   DD   SYSOUT=*                       
//SORTOUT  DD   SYSOUT=*                       
//SORTIN   DD  *                               
XXX AAA AAA AAA                               
XXX AAA AAA AAA                               
XXX AAA AAA AAA                               
XXX BBB BBB BBB                               
XXX BBB BBB BBB                               
XXX BBB BBB BBB                               
XXX CCC CCC CCC                               
XXX DDD DDD DDD                               
/*                                             
//SYSIN    DD  *                               
  INREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,80))
  SORT FIELDS=COPY                             
  OUTFIL INCLUDE=(81,8,ZD,LT,3),BUILD=(1,80)   
/*
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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

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