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
 

 

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: 58
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: 2180
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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