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
 
Need to skip and select records consecutively using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need to skip and select records consecutively using Syncsort
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

Moderator


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

PostPosted: Wed Jun 20, 2012 6:42 pm    Post subject:
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    Post subject: Reply to: Need to skip and select records consecutively usin
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: 6968
Location: porcelain throne

PostPosted: Wed Jun 20, 2012 7:42 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Wed Jun 20, 2012 8:03 pm    Post subject: Reply to: Need to skip and select records consecutively usin
Reply with quote

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

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

and the DFSORT manual page
http://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

Moderator


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

PostPosted: Wed Jun 20, 2012 8:11 pm    Post subject:
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    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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
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 Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

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