View previous topic :: View next topic
|
Author |
Message |
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
I would like to create a subset of a VERY large main file. The records in this file need to be copied into the subset file in the same exact order as they are in the main file.
The file consists of groups of records, each one pertaining to a specific customer account number.
I cannot simply specify a number of records because the accounts don't have a fixed number of records -- each account could have more or less records than another.
So I'd like to simply copy all records with, say, "0211" in positions 4-7, which would give me a whole group of accounts.
SORT won't work because the main file is REALLY huge and I don't want the rec order changed anyway. I don't see any options in IEBCOPY, IEBGENER, or IDCAMS REPRO that will do what I need.
Any thoughts? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
SORT won't work because the main file is REALLY huge and I don't want the rec order changed anyway. |
why not? ever heard of OPTION COPY, OMIT, INCLUDE |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
I am familiar with those options.
As I said, the file in question is huge, and the time/resources to do something like this are equally so. SORT is not a practical choice. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
why do You think that using a different tool will give better results ?
IEBCOPY is used to deal with PDS
IEBGENER is used to deal with sequential dataset
IDCAMS with PS and VSAM
apart IEBCOPY whichis designed for something else SORT will outperform the other two utilities You are talking about
if the file is a PS and the records You want to extract are the last ones, whatever the utility You will have to skip all the preceding records |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You can tell SORT not to change the record order, you know. And there is not likely to be anything faster than sort for processing a large file. |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
So, it is your belief that SORT is my only option? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
YES |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Since I'm dealing with a sequential dataset, and since the records I want to pull are all at the beginning of the file, I thought perhaps IEBGENER would keep it simple; i.e. not require huge SORTWK allocations. (Running w/default allocations resulted in an SB37.)
I hate to run a resource hog if I don't have to. I'll figure something else out.
Thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
IIRC for "OPTION COPY" sort does not need any sortwk' s |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If you know the records you want are all at the beginning of the file, you can use SORT or IDCAMS to copy off the first X records (where X is a number large enough to ensure you're getting everything you want) into another, smaller file, then hit that file with the selection criterion. IDCAMS allows you to specify the number of records to copy with the COUNT parameter -- or use SORT STOPAFT to limit the records. |
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Robert's suggestion is what I would have tried. I hadn't considered Enrico's point about COPY not needing SORTWK, but that could be because I'm working on three crises and it's only lunchtime.
Thanks -- I'll give it a whirl after the current crisis is resolved ... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
Jenifer Lewis
New User
Joined: 14 Sep 2009 Posts: 28 Location: Maine
|
|
|
|
Great link -- I've got a short cut to it now.
The last time I held an IBM JCL manual in my hands was sometime in the early 90's, and my only MVS JCL manual has been the one written by Doug Lowe. I tend to turn to that first because I am a dinosaur after all and like paging through manuals.
But Lowe admits he doesn't cover everything, and when it's been a while since I've had to pull a rabbit out of my hat I look on mainframe fora like this one. Usually I find what I'm looking for right away, but in this case I didn't.
I recently (finally) learned about ICETOOL, which is very cool, and I've been able to perform seeming miracles for my business analysts here, which is a lot of fun.
Thank you both again for your help! |
|
Back to top |
|
|
|