View previous topic :: View next topic
|
Author |
Message |
kc.karthik
New User
Joined: 15 Apr 2007 Posts: 8 Location: Foster City, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
kc.karthik
New User
Joined: 15 Apr 2007 Posts: 8 Location: Foster City, CA
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
kc.karthik
New User
Joined: 15 Apr 2007 Posts: 8 Location: Foster City, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
Are you able to continue or is there something else needed? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|