Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

selecting records from huge dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Thu Oct 16, 2008 12:51 am    Post subject: selecting records from huge dataset
Reply with quote

Hi all, i have a dataset containing some 10,000 records. I have to extract records based on their relative position in the file. for example I want the records in interval of 1000. 1000th rec, 2000th rec .....10,000th record. So my output file should contain only 10 records. I have used STARTREC & STOPREC. But I am able to fetch only 1 record at a time.

Say for example if I use the below sort card:

Code:
STARTREC=1000,ENDREC=1000
STARTREC=2000,ENDREC=2000
STARTREC=3000,ENDREC=3000


Only the 3000th record is getting copied. I tried using SKIPREC as well but in that case I am able to skip records initially and select from there. But in my scenario i want the skipping intermitently.Can anyone pls let me know how to iterate selection by skipping every 1000 recs?
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Oct 16, 2008 1:18 am    Post subject:
Reply with quote

You can use the following DFSORT control statements:

Code:

  OPTION COPY                         
  OUTFIL STARTREC=1000,SAMPLE=1000     
Back to top
View user's profile Send private message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Thu Oct 16, 2008 2:43 am    Post subject:
Reply with quote

It worked Frank. Thank you very much for your help
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Oct 16, 2008 2:52 am    Post subject:
Reply with quote

Frank,

What does Sample exactly do ?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Oct 16, 2008 3:19 am    Post subject:
Reply with quote

Here's the description of SAMPLE from "z/OS DFSORT Application Programming Guide".

SAMPLE= n or SAMPLE=(n,m)

Specifies a sample of OUTFIL input records to be processed for this OUTFIL group. The sample consists of the first m records in every nth interval.

n specifies the interval size. The value for n starts at 2 (sample every other record) and is limited to 28 digits (15 significant digits).

m specifies the number of records to be processed in each interval. The value for m starts at 1 (process the first record in each interval) and is limited to 28 digits (15 significant digits). If m is not specified, 1 is used for m. If m is specified, it must be less than n.

Sample Syntax:

Code:

* PROCESS RECORDS 1, 6, 11, ...
   OUTFIL FNAMES=OUT1,SAMPLE=5
* PROCESS RECORDS 1, 2, 1001, 1002, 2001, 2002
   OUTFIL FNAMES=OUT2,SAMPLE=(1000,2),ENDREC=2500
* PROCESS RECORDS 23, 48, 73
   OUTFIL FNAMES=OUT3,STARTREC=23,ENDREC=75,SAMPLE=25
* PROCESS RECORDS 1001, 1002, 1003, 1101, 1102, 1103, ...
   OUTFIL FNAMES=OUT4,STARTREC=1001,SAMPLE=(100,3)


Note: All of the DFSORT books are available online at:

www.ibm.com/systems/support/storage/software/sort/mvs/srtmpub.html
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us