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
 

 

How to find the nth record from a huge dataset?

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

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Mon Apr 16, 2007 12:30 am    Post subject: How to find the nth record from a huge dataset?
Reply with quote

Is there a way to get the nth record from a huge dataset? Lets say I have a dataset of 75 million records and the 4 millionth records is erraneous. How can I just fetch that record using DFSORT/ICETOOL or in any other way in JCL?

Thanks in advance.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 16, 2007 12:39 am    Post subject:
Reply with quote

Hello,

How do you know exactly which record is the problem record? Might there be more "bad" records after the 4millionth one? What makes the record(s) erroneous?

If you want to do something with only the one record (specified by number of records from the beginning of the file, you can do this with SKIPREC and STOPAFT.
Back to top
View user's profile Send private message
kc.karthik

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Mon Apr 16, 2007 12:43 am    Post subject: Re: How to find the nth record from a huge dataset?
Reply with quote

Thanks for your quick reply. Druing my DB loading process the records that have been rejected are filtered separately with the exact sequence no. in the dataset. SO I have more than one erroneous data but not in sequence but at irregulare intervals in the dataset.

I am new to mainframe sine this is teh first time I am dealing with mainframe datasets as sources. Could you pls tell me how cna you use SKIPREC to locate a particular record?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Apr 16, 2007 1:02 am    Post subject:
Reply with quote

Sort material is here: DFSORT/ICETOOL Reference Material
IDCAMS can do it also.
It might be easier to use OMIT to re-filter the bad records out.
It would make the most sense for the loading program to filter them out upon loading.
Back to top
View user's profile Send private message
kc.karthik

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Mon Apr 16, 2007 1:42 am    Post subject: Re: How to find the nth record from a huge dataset?
Reply with quote

Thanks a lot for your help. I will be modifying the DB loading process to filter out properly formatted records so we can use them directly to correct. Currently it is an existing process which I am taking over.

Thanks again for all your help.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 16, 2007 3:28 am    Post subject:
Reply with quote

You're welcome icon_smile.gif

Are you able to continue or is there something else needed?
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: Tue Apr 17, 2007 10:34 pm    Post subject:
Reply with quote

SKIPREC and STOPAFT are fine for extracting one record or a contiguous group of records. OUTFIL with STARTREC and ENDREC can do that too.

If you want to extract specific records with different relative record numbers, you can use OVERLAY to add a sequence number to the records and then use OUTFIL INCLUDE to select the records you want. For example, if you wanted records 5002, 9003 and 28002 from an input file with RECFM=FB and LRECL=80, you could use a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(81:SEQNUM,8,ZD)
  OUTFIL BUILD=(1,80),
   INCLUDE=(81,8,ZD,EQ,+5002,OR,
            81,8,ZD,EQ,+9003,OR,
            81,8,ZD,EQ,28002)
/*
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: Tue Sep 02, 2008 11:33 pm    Post subject:
Reply with quote

If you want to extract specific records with different relative record numbers, you can now do that quite easily using the new SUBSET operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). For example:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DISP=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) INPUT KEEP RRN(5002) RRN(9003) RRN(28002)
/*


For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


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