View previous topic :: View next topic
|
Author |
Message |
Geethi
New User
Joined: 03 Mar 2007 Posts: 10 Location: US
|
|
|
|
Hi,
Would anyone please let me know how to rename a set of datasets having the first qualifier xxxx.* to yyyy.*. The dataset include flat files and PDS.
Thanks, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
IDCAMS ALTER |
|
Back to top |
|
|
Geethi
New User
Joined: 03 Mar 2007 Posts: 10 Location: US
|
|
|
|
But if i use generic character in IDCAMS ALTER NEWNAME, it would replace only one qualifier; not all the qualifiers that follow the HLQ, isn't it?. In my case, the number of qualifiers varies. Please let me know how I can do this ?
Thanks, |
|
Back to top |
|
|
Geethi
New User
Joined: 03 Mar 2007 Posts: 10 Location: US
|
|
|
|
I need to change the HLQs of the following DSNs
xxx.NEW.DATA
xxx.OLD
xxx.NEW.OLD.MATCH
to
yyy.NEW.DATA
yyy.OLD
yyy.NEW.OLD.MATCH
Please let me know if I could make the issue more clear. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
ALTER 'old dataset name' NEWNAME('new dataset name')
But first you must get a listing of every dataset which has that HLQ, and then build the ALTER commands for each and every dataset that exists with that HLQ. |
|
Back to top |
|
|
Geethi
New User
Joined: 03 Mar 2007 Posts: 10 Location: US
|
|
|
|
I have 1000+ datasets to rename. To build an ALTER command for each and every dataset is very time comsuming. Is there a better way ? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You can use REXX, DFSORT, EASYTRIEVE, COBOL, ad infinitum .......... to build the ALTER cards for you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
FWIW - even if you could build the ALTER statements quickly, i'd suggest you not do so - too much chance for error.
If you write a bit of code and test it well, you will eliminate those errors.
Additionally, once you have this coded and running, you put it on the shelf and if you ever need to do something similar, you have most of the work already done |
|
Back to top |
|
|
Geethi
New User
Joined: 03 Mar 2007 Posts: 10 Location: US
|
|
|
|
I am unable to spend much time to code a program to rename the HLQs. Would you please provide me with the syntax of DFSORT/EASYRETRIEVE ?
Thanks, |
|
Back to top |
|
|
|