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

Get first 2 records using SYNCSORT


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

New User


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

PostPosted: Thu Jan 29, 2009 12:33 pm
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: 2481
Location: @my desk

PostPosted: Thu Jan 29, 2009 1:12 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top