IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to copy recs w/specific data string from non-vsam file?


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Mon Sep 14, 2009 8:39 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Sep 14, 2009 8:47 pm
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Mon Sep 14, 2009 8:58 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Sep 14, 2009 9:07 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Sep 14, 2009 9:07 pm
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Mon Sep 14, 2009 9:12 pm
Reply with quote

So, it is your belief that SORT is my only option?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Sep 14, 2009 9:13 pm
Reply with quote

YES
Back to top
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Mon Sep 14, 2009 9:20 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Sep 14, 2009 9:25 pm
Reply with quote

IIRC for "OPTION COPY" sort does not need any sortwk' s
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Sep 14, 2009 9:26 pm
Reply with quote

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
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Mon Sep 14, 2009 9:31 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Sep 14, 2009 9:37 pm
Reply with quote

see also

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Jenifer Lewis

New User


Joined: 14 Sep 2009
Posts: 28
Location: Maine

PostPosted: Tue Sep 15, 2009 5:20 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top