MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Move DS with new HLQ added

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
autobox
Beginner


Joined: 03 Mar 2006
Posts: 2
Topics: 1

PostPosted: Sat May 21, 2011 3:25 am    Post subject: Move DS with new HLQ added Reply with quote

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.

Thanks.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sat May 21, 2011 7:48 pm    Post subject: Reply with quote

Suggest you not use copy. . .

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,

di
Back to top
View user's profile Send private message
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Sun May 22, 2011 1:55 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Jun 03, 2011 6:38 am    Post subject: Reply with quote

Excellent mood on. The REXX reads the DFdss dump SYSPRINT and applies naming changes as per PARMS DD * cards supplied.
Code:
//STEP0020 EXEC PGM=IKJEFT01,PARM='DFDSSRSU'
//SYSEXEC  DD DSN=uid.REXX,DISP=SHR
//SYSOUT   DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD DUMMY
//DFDSSIN  DD DSN=uid.DFDSS.SYSPRINT,DISP=SHR
//DFDSSOUT DD DSN=uid.DFDSS.CONTROL.STATMNTS,DISP=(,CATLG,DELETE),
//            RECFM=FB,LRECL=80,SPACE=(TRK,(75,75),RLSE)
//DFDSSPRT DD SYSOUT=*
//SORTIN   DD DSN=&&TEMP01,DISP=(,PASS,DELETE),
//            RECFM=FB,LRECL=100,SPACE=(TRK,(75,75),RLSE)
//SORTOUT  DD DSN=&&TEMP02,DISP=(,PASS,DELETE),
//            RECFM=FB,LRECL=100,SPACE=(TRK,(75,75),RLSE)
//EXCLUDE  DD *
**ASIS
/*
//PARMS    DD *
XX. XX.TEST.RENAME.


And the REXX code
Code:
/* 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"

DS  = 0
ER  = 0
EX  = 0
RN  = 0
OPT = 0

"EXECIO * DISKR PARMS    ( STEM PARM. FINIS"
"EXECIO * DISKR EXCLUDE  ( STEM EXCL. FINIS"
"EXECIO * DISKR DFDSSIN  ( STEM DF.   FINIS"
"EXECIO" DF.0 "DISKW DFDSSPRT ( STEM DF. FINIS"

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 ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group