Posted: Sat May 21, 2011 3:25 am Post subject: Move DS with new HLQ added
Hi all,
Please advise how to move large volumes of DS from one DASD to another with new HLQ added to the original DS name, such as:
OLDHLQ.** on DASD01 -> NEWHLQ.OLDHLQ.** on DASD02
I tried ADRDSSU COPY, but sames the RENAMEU/RENUNC can only REPLACE OLDHLQ to NEWHLQ.
Backup the datasets to high-volume media (E-cart / "fat tape" / whatever) and then restore them to the new names.
Before running this, make sure the new HLQ has been properly defined by testing if you can successfully create a file (ispf 3.2?). _________________ All the best,
If you are Application Developer - why are you thinking about allocating a brand new HLQ? It should not be expected from you, as an Application Developer.
When a systems programmer defines a new high level qualifier, it is defined and then related to a user catalog so new data sets are cataloged in the user catalog, not the master catalog. This removes the need for application programmers to update the master catalog.
And if you are a System Programmer, I hope you know, if an attempt is made to allocate a data set with a new high level qualifier not in the user catalog, then system attempts to place the catalog entry in the master catalog. And, since most sites restrict master catalog updates to systems programmers - you should not have any problem as Sys-programmer, otherwise, such an attempt will most likely fail. _________________ Regards,
Anuj
/* REXX *** CHANGE HLQ & ADD LLQ FOR DFDSS RESTORE PARAMETERS
IF NEW HLQ = EXISTING HLQ THEN USE *NONE* AS NEW HLQ */
BREC = COPIES(' ',69)||"-"
ASIS = "Y"
XSIS = "Y"
DO A = 1 TO PARM.0
PARSE VAR PARM.A PFXI.A PFXO.A SFXO.A .
LENI.A = LENGTH(STRIP(PFXI.A))
PUSH LEFT(PFXI.A,30) LEFT(PFXO.A,30) LEFT(SFXO.A,30) RIGHT(LENI.A,2)
"EXECIO 1 DISKW SORTIN"
END
"EXECIO 0 DISKW SORTIN ( FINIS"
"CALL *(SORT)"
PFXI. = ""
PFXO. = ""
SFXO. = ""
LENI. = ""
"EXECIO * DISKR SORTOUT ( STEM PARM. FINIS"
DO A = 1 TO PARM.0
PARSE VAR PARM.A 1 PFXI.A 31 . ,
32 PFXO.A 61 . ,
63 SFXO.A 92 .
IF LEFT(SFXO.A,1) <> "." & LENGTH(STRIP(SFXO.A)) > 0
THEN SFXO.A = STRIP("."||SFXO.A)
IF SFXO.A = "."
THEN SFXO.A = ""
PFXI.A = STRIP(PFXI.A)
PFXO.A = STRIP(PFXO.A)
LENI.A = LENGTH(PFXI.A)
END
PFXI.0 = PARM.0
VAL = 0
DO B = 1 TO DF.0
IF POS('ADR412E',DF.B) > 0 THEN DO
ERR1 = SUBSTR(DF.B,POS('ADR412E',DF.B)+34,44)
ERR1 = SUBSTR(ERR1,1,POS(' ',ERR1)-1)
ER = ER + 1
ERR.ER = "DATASET NOT DUMPED BY DFDSS " ERR1
ITERATE B
END
IF VAL = 0 & POS('ADR454I',DF.B) = 0 & POS('ADR475I',DF.B) = 0
THEN ITERATE
VAL = VAL + 1
IF VAL = 1 THEN ITERATE
IF POS('1PAGE',DF.B) > 0 THEN ITERATE
IF POS('ADR006I',SUBSTR(DF.B,1,20)) > 0 THEN DO
B = DF.0 + 1
ITERATE B
END
DSN1 = STRIP(SUBSTR(DF.B,28,44))
IF LEFT(DSN1,7) = "CLUSTER" THEN
DSN1 = STRIP(SUBSTR(DF.B,43,44))
IF LEFT(DSN1,7) = "CATALOG" | LEFT(DSN1,7) = "COMPONE" THEN ITERATE
DS = DS + 1
DSN.DS = DSN1
END
ERR.0 = ER
DSN.0 = DS
DO A = 1 TO DSN.0
DO B = 1 TO EXCL.0
IF EXCL.B = "**ASIS" THEN DO
ASIS = "N"
ITERATE B
END
IF EXCL.B = "**XSIS" THEN DO
XSIS = "N"
ITERATE B
END
GEN = 0
IF POS('*',EXCL.B) > 0 THEN GEN = 1
IF GEN <> 0 THEN DELET = SUBSTR(EXCL.B,1,POS('*',EXCL.B)-1)
ELSE DELET = STRIP(EXCL.B)
LENDEL = LENGTH(DELET)
IF LEFT(DSN.A,LENDEL) = DELET THEN DO
IF GEN <> 0 THEN DO
EX = EX + 1
EXCLD.EX = DSN.A
DSN.A = OVERLAY(COPIES(' ',44),DSN.A,1,44)
ITERATE A
END
ELSE DO
IF LENGTH(STRIP(DSN.A)) = LENDEL THEN DO
EX = EX + 1
EXCLD.EX = DSN.A
DSN.A = OVERLAY(COPIES(' ',44),DSN.A,1,44)
ITERATE A
END
END
END
END
END
DO A = 1 TO DSN.0
DO B = 1 TO PFXI.0
IF DSN.A <> " " THEN DO
IF LEFT(DSN.A,LENI.B) = PFXI.B THEN DO
IF PFXO.B = "*NONE*" & SFXO.B = ".*NONE*" THEN DO
DSN.A = OVERLAY(COPIES(' ',44),DSN.A,1,44)
ITERATE A
END
IF PFXO.B <> "*NONE*" THEN
DSN2.A = STRIP(PFXO.B||STRIP(SUBSTR(DSN.A,LENI.B+1,44))||SFXO.B)
ELSE DSN2.A = STRIP(DSN.A)||STRIP(SFXO.B)
B = PFXI.0
IF LENGTH(DSN2.A) > 44 THEN DO
EX = EX + 1
EXCLD.EX = DSN.A
ER = ER + 1
ERR.ER = "*** CHANGED DATASET NAME EXCEEDS 44 CHARACTERS"
ER = ER + 1
ERR.ER = "*** " DSN2.A
ER = ER + 1
ERR.ER = "*** BASE DSN " DSN.A
DSN.A = OVERLAY(COPIES(' ',44),DSN.A,1,44)
END
END
END
END
END
EXCLD.0 = EX
ERR.0 = ER
B = 0
C = 0
DO A = 1 TO DSN.0
IF DSN.A <> " " THEN DO
B = B + 1
DSN.B = DSN.A
IF LEFT(DSN2.A,5) = "DSN2." THEN DO
DSN2.B = " "
C = C + 1
END
ELSE DO
DSN2.B = DSN2.A
END
END
END
DSN.0 = B
SAY "NUMBER OF DSNS EXCLUDED " RIGHT(EX,6)
SAY " "
SAY "NUMBER TO RESTORE " RIGHT(B,6)
SAY " "
SAY "NUMBER TO RESTORE ASIS " RIGHT(C,6)
SAY " "
SAY "NUMBER TO RESTORE CHANGED" RIGHT(B-C,6)
DO A = 1 TO EXCLD.0
SAY "EXCLUDE " EXCLD.A
END
/* WRITE RESTORE "ASIS" RECORDS */
B = 0
IF ASIS = "Y" THEN DO
DO A = 1 TO DSN.0
IF B = 0 THEN DO
B = B + 1
PUSH OVERLAY("REST INDD(BACKUP)",BREC,2)
"EXECIO 1 DISKW DFDSSOUT"
PUSH OVERLAY("DATASET(INCLUDE(",BREC,8)
"EXECIO 1 DISKW DFDSSOUT"
END
IF DSN2.A = " " THEN DO
B = B + 1
PUSH OVERLAY(DSN.A,BREC,12)
"EXECIO 1 DISKW DFDSSOUT"
END
IF B = 256 | A = DSN.0 THEN DO
PUSH OVERLAY(" ))",BREC,8)
"EXECIO 1 DISKW DFDSSOUT"
PUSH " CATALOG REPLACEU SPHERE"
"EXECIO 1 DISKW DFDSSOUT"
B = 0
END
END
END
/* WRITE RESTORE RENAME RECORDS */
B = 0
IF XSIS = "Y" THEN DO
DO A = 1 TO DSN.0
IF B = 0 THEN DO
B = B + 1
PUSH OVERLAY("REST INDD(BACKUP)",BREC,2)
"EXECIO 1 DISKW DFDSSOUT"
PUSH OVERLAY("DATASET(INCLUDE(",BREC,8)
"EXECIO 1 DISKW DFDSSOUT"
END
IF DSN2.A <> " " THEN DO
B = B + 1
PUSH OVERLAY(DSN.A,BREC,12)
"EXECIO 1 DISKW DFDSSOUT"
QUEUE OVERLAY("("DSN.A,BREC,12)
QUEUE OVERLAY(DSN2.A")",BREC,16)
END
IF B = 256 | A = DSN.0 THEN DO
PUSH OVERLAY(" ))",BREC,8)
"EXECIO 1 DISKW DFDSSOUT"
PUSH OVERLAY(" RENUNC( ",BREC,8)
"EXECIO 1 DISKW DFDSSOUT"
"EXECIO " QUEUED() "DISKW DFDSSOUT"
PUSH OVERLAY(" )",BREC,8)
"EXECIO 1 DISKW DFDSSOUT"
PUSH " CATALOG REPLACEU SPHERE"
"EXECIO 1 DISKW DFDSSOUT"
B = 0
END
END
END
_________________ If it's true that we are here to help others,
then what exactly are the others here for ?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum