Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to copy datasets starting with a common Qualifier.

Status
Not open for further replies.

KJSanthosh

Programmer
Jan 30, 2003
5
0
0
US
Hi,
I want to know how to copy multiple datasets starting with a common qualifier to another qualifier.

Ex:- There are hundreds of datasets starting with AAAA.*
All these datasets needs to be copied to datasets BBBB.*.

Is there any Rexx function which will make this work easier.

Please Help Immediately..

This is urgent..

Thanks
 
Do you have DFDSS or FDR? This will do exactly what you want to achieve.
 
I have DFDSS..I saw a syntax for copying datasets from one volume to other. Is there any way to copy those datasets to another with a different name?

If not, is there any REXX which can do this functioinality??
 
Hmmmmm We use FDR here and that has a facility of doing a rename on a restore. I would expect DFDSS to have something similar that could help you.

Doing an IDCAMS ALTER for each dataset MAY work, but I would be very careful of things like multi-volume datasets GDG's and of cource catalogs. You may also get into a hess of a mess if the high level qualifier is in another catalog. If your files are purely non VSAM things are a lot easier.

I would have a word with the storage administrators and see if they can help you.
 
Yeah...My files are all Non VSAM..Could you suggest something?
 
You could try this:

/* rexx */
Say 'High level qualifier'
pull hlq
say 'New HLQ'
pull new
call outtrap 'listc.'
"listc lvl('"hlq"') "
call outtrap 'off'
DO I = 1 TO listc.0
test = word(listc.i,1)
if test = 'NONVSAM' then do
dsn = word(listc.I,3)
dsn = strip(dsn)
lastcc = POS('.',dsn)
len = length(dsn)
len = len - lastcc + 1
suf = substr(dsn,lastcc,len)
flq = new||suf
say dsn
say flq
&quot;alter '&quot;dsn&quot;' NEWNAME('&quot;flq&quot;')&quot; /* <== this renames */
end
else iterate
end
EXIT

Obviously test it before you do it!
 
That works, but the code inside the loop could be cut down and made lots more efficient and readable:
Code:
parse var listc.i   tag . dsn . /* strips dsn */
if tag <> &quot;NONVSAM&quot; then iterate 
parse var dsn  orighlq &quot;.&quot; tail 
newdsn = new&quot;.&quot;tail
&quot;ALTER&quot; dsn &quot;NEWNAME(&quot;newdsn&quot;)&quot;  /* rename it */

Any string passed to a host-function should be all-uppercase. IDCAMS is particularly snarly about that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top