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: 2352
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 Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

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