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

Need to skip and select records consecutively using Syncsort


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

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Wed Jun 20, 2012 6:24 pm
Reply with quote

Hi,

Suppose if i have 10000 records in my i/p file . i need to select only 100th, 200th, 300th ..... 10000th record.. ie.. i need to select records with are located in multiples of 100.

Please provide me code using Syncsort.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Jun 20, 2012 6:42 pm
Reply with quote

I dont have Syncsort product so cant provide exact solution

But the approach you need to follow is

1.Add sequence number at the end say at postion 81 ( Assuming your input is 80 ) having length 5
2.Select only those records having 00 or 000 or 0000 in the end
Back to top
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Wed Jun 20, 2012 7:13 pm
Reply with quote

Its Done............. using below code


SORT FIELDS=COPY
OUTREC OVERLAY=(80:SEQNUM,5,ZD)
OUTFIL INCLUDE=(81,4,ZD,EQ,0000,OR,(80,1,ZD,EQ,0,AND,82,3,ZD,EQ,000),
OR,(80,2,ZD,EQ,00,AND,83,2,ZD,EQ,00),OR,(83,2,ZD,EQ,00),OR,
(80,1,ZD,EQ,0,AND,83,2,ZD,EQ,00),OR,(82,3,ZD,EQ,000))
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 20, 2012 7:42 pm
Reply with quote

since you need every 100th record,
just look for the 00 as the last 2 of the 5 char sequence number,
and get rid of the rest of the garbage.

keep in mind, if you have an 80 char record, you want to overlay 81.

according to your OVERLAY statement, your records are 79 or less.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 20, 2012 8:03 pm
Reply with quote

IIRC DFSORT has a <sample> function/capablity, verify if SYNCORT can do the same

see this topic
www.ibmmainframes.com/viewtopic.php?t=53354&highlight=dfsort+sample

and the DFSORT manual page
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca30/3.13?ACTION=MATCHES&REQUEST=sampling&TYPE=FUZZY&SHELF=ICE1SH31.bks&DT=20080528171007&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

not the latest one probably, but it describes the <sample> capability
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Jun 20, 2012 8:11 pm
Reply with quote

Thanks Enrico icon_biggrin.gif

Very useful indeed
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 Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top