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: 2285
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm

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