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 copy recs w/specific data string from non-vsam file?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> HomeWorks & Requests
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    Post subject: how to copy recs w/specific data string from non-vsam file?
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 14, 2009 8:47 pm    Post subject: Reply to: how to copy recs w/specific data string from non-v
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 14, 2009 9:07 pm    Post subject: Reply to: how to copy recs w/specific data string from non-v
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: 7913
Location: Bellevue, IA

PostPosted: Mon Sep 14, 2009 9:07 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 14, 2009 9:13 pm    Post subject: Reply to: how to copy recs w/specific data string from non-v
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 14, 2009 9:25 pm    Post subject: Reply to: how to copy recs w/specific data string from non-v
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: 7913
Location: Bellevue, IA

PostPosted: Mon Sep 14, 2009 9:26 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 14, 2009 9:37 pm    Post subject: Reply to: how to copy recs w/specific data string from non-v
Reply with quote

see also

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> HomeWorks & Requests All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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