CA Endevor

Expand all | Collapse all

PDS to PDSE CONVERSION

Jump to Best Answer
  • 1.  PDS to PDSE CONVERSION

    Posted 04-18-2016 05:11 PM

    I am aware that there is a BSTXCOPY utility from CA to assisst with copying PDSs to PDSEs,  however, I have literally thousands of PDSs that need to be converted and I'm looking for a way to do this automagically.  I don't want to have to look at each dataset, figure out what the space, etc should be so that I can enter that information to create the new PDSE.  None of the utilities I've found anywhere, have a way to clone an existing PDS as a PDSE.  Does anyone know if anything like this exists?



  • 2.  Re: PDS to PDSE CONVERSION

    Posted 04-18-2016 05:26 PM

    Hello,  Below is an example of the IBM utility that may help.  You will want to modify the keywords for your files.

     

     

     

    //USERID JOB ...

     

    //*

     

    //* CONVERT ALL PDSS FOR USER TO PDSES,

     

    //* WITH THE EXCEPTION OF PDSS WITH A LOW LEVEL QUALIFIER OF '.LOAD'

     

    //*

     

    //STEP1 EXEC PGM=ADRDSSU

     

    //SYSPRINT DD SYSOUT=*

     

    //SYSIN DD *

     

    COPY DATASET( -

     

    INCLUDE(USER.**) -

     

    EXCLUDE(**.LOAD) -

     

    BY(DSORG,EQ,PDS) -

     

    ) -

     

    CONVERT(PDSE(**)) -

     

    CATALOG -

     

    DELETE PURGE -

     

    REPLACE -

     

    WAIT(2,2)



  • 3.  Re: PDS to PDSE CONVERSION

    Posted 04-18-2016 05:33 PM

    I also want to be able to use this for Loadlibs and the comments say this can’t be used for that.  Is that the case?  I want to use this for all sorts of PDSs, Load and non-Load.

     

    Thanks.



  • 4.  Re: PDS to PDSE CONVERSION

    Posted 04-18-2016 05:38 PM

    DFDSS will remove the footprints for load modules, BSTXCOPY is the only way


    Have you used the LIKE= parameter on a dataset allocation?


    You could create the .NEW dataset like the input dataset so you could create a proc with a symbolic input dataset to do lots of datasets, maybe


    Stuart



  • 5.  Re: PDS to PDSE CONVERSION

    Posted 04-19-2016 12:44 PM

    Thanks Stuart.  When you say 'Like' how aare you doing the allocation?  My problem is that we have some huge datasets and I don't want to try and guess how much space to allocate for these datasets and then have it fail on the copy, so if I could create a job that does a define and then a copy, that would be great.  I just don't know anything that will define 'like', but make the new dataset a PDSE regardless of the initial dataset.  Right now, I could use ADRDSSU to create the new PDSE and then BSTXCOPY to copy over the information (with footprints), I'm just having a little trouble getting ADRDSSU to create the PDSE with a different name.  If you have a way to do an allocation with 'Like' in a batch job, that would be great.  Thanks.



  • 6.  Re: PDS to PDSE CONVERSION

    Posted 04-19-2016 01:11 PM

    If you look at the post from Phon_Shuffitt you will see the JCL with the like statement coded



  • 7.  Re: PDS to PDSE CONVERSION

    Posted 04-18-2016 05:40 PM

    The IEBCOPY LIKE allocation/copy you can do that.

     

    //GROUPCPY  EXEC PGM=IEBCOPY

    //SYSPRINT  DD  SYSOUT=A

    //I1        DD  DSN=my.pds,DISP=SHR

    //O1      DD  DSN=my.new.pdse,

    //                LIKE=my.pdse,DSNTYPE=LIBRARY,      With that you are overriding the PDS and making the new a PDSE.

    //                DISP=(NEW,CATLG),

    //                SPACE=(CYL,(20,15))

    //SYSUT3    DD  UNIT=SYSDA

    //SYSIN    DD  *

    GROUPCPY  COPYGRP  INDD=((I1,R)),OUTDD=O1


    Stuart made a good point with LOADLIB you might consider using BSTXCOPY as it will perserve the Footprint as it is specifically designed for LOAD libraries.

    Try that out.

    Have a great day,

    Phon



  • 8.  Re: PDS to PDSE CONVERSION

    Posted 04-19-2016 10:31 AM

    Here is another approach that makes it easier when working with thousands of files  - use the Table Tool (ENBPIU00). See Table Tools Examples 

    1. Do a 3.4 to build a list of datasets, then say "SAVE MYLIST". This gives you a "table".
    2. You can then code an IEBCOPY step as in the example from Phon, or use REXX statements as your Model or OPTIONS.
    3. Submit your Table Tool job which then performs an allocate, copy and two renames for each file in your 3.4 list (MYLIST)


  • 9.  Re: PDS to PDSE CONVERSION

    Posted 08-27-2018 01:16 PM

    Can i use the INDD and OUTDD as same..because i just want to convert the PDS to PDSE(i dont want to create a new one)

     

    //STEP1 EXEC PGM=BSTXCOPY
    // INCLUDE MEMBER=SCMM@LIB
    //SYSPRINT DD SYSOUT=*
    //BSTERR DD SYSOUT=*
    //SYSUT3 DD UNIT=VIO,SPACE=(CYL,(1,2))
    //SYSUT4 DD UNIT=VIO,SPACE=(CYL,(1,2))
    //IND1 DD DISP=(OLD,PASS),
    // DSN=MYDSN (PDS OR PDSE)
    //OUTDD DD DISP=(OLD,PASS),
    // DSN=MYDSN (PDS OR PDSE)
    //SYSIN DD *
    COPY INDD=((IND1,R)),OUTDD=OUTDD
    COPY INDD=((IND2,R)),OUTDD=OUTDD



  • 10.  Re: PDS to PDSE CONVERSION

    Posted 08-29-2018 07:25 PM

    Probably the safest answer to your question is --- try it.  Choose a single PDS dataset of no value and see how it behaves. Please also, let us know how it goes.

     

    A alternative is to make a change in the example JCL from this....  

    //MODEL2   DD *

      RENAME '&Dataset' +

             '&Dataset.OLD'

      RENAME '&Dataset.NEW' +

             '&Dataset'

     

    To this.....

    //MODEL2   DD *

      DELETE  '&Dataset'

      RENAME '&Dataset.NEW' +

             '&Dataset'



  • 11.  Re: PDS to PDSE CONVERSION

    Posted 04-19-2016 01:19 PM

    Thanks to everybody for their help.  I believe I have a working process now.



  • 12.  RE: Re: PDS to PDSE CONVERSION

    Posted 12-03-2019 08:19 AM
    ​How did this work out for you guys Felicity? My shop is considering converting to PDSEs also but I have concerns about the load libs and deadlocks.

    ------------------------------
    RACF Admin and minor system duties
    State of New York
    ------------------------------



  • 13.  RE: Re: PDS to PDSE CONVERSION

    Posted 12-03-2019 09:16 AM

    ​Hey,

    The conversion worked out well for us.  I do remember we had some problem when PDSEs and PDSs were trying to work together, but I'll have to check my notes to see what the issue was.  We have converted everything o PDSes, except we have some ELIBs left which I'd like to change to PDSes.

    If you'd like more info, send me a note.

    Thanks.



    ------------------------------
    Felicity
    ------------------------------



  • 14.  RE: PDS to PDSE CONVERSION
    Best Answer

    Posted 12-10-2019 06:21 PM
    ​I rely on a REXX EXEC as shown below to create TSO allocate commands for PDSE libraries corresponding to every PDS library matching a library name pattern (optionally skipping older PDS libraries by creation date). The VSAM DEFINE subroutine can be removed. This is executed with JCL, the allocate commands are then saved to a sequential dataset (FB 80), modified, and then executed with another JCL. Then the copy JCL needs to be coded and executed, and maybe the new and old libraries will need to be renamed. Some of that could probably also be partially automated by adding more code to this to REXX exec to create the copy and rename or delete commands, if anyone is interested.

    /* REXX */

    cat_dsn.0 = 0

    /* Note: creation date not available for some VSAM */

    /* Creation date day in Year/day format, for example: 1985/102 */

    startyear = ''

    afterday = ''

    Call CATLIST('data'set name pattern here')

    DO dsn# = 1 TO cat_dsn.0

    dsn = cat_dsn.dsn#

    rc = LISTDSI("'"||dsn||"'" 'DIRECTORY')

    If rc > 0 Then Do

    IF SYSDSORG == 'VS' Then Call VSAM(dsn)

    Iterate

    End

    /* For converting PDS to PDSE format, skip all PDSE */

    /*If SYSDSSMS == 'PDSE' Then Iterate */

    If afterday <> '' Then Do

    cryear = Left(SYSCREATE,4)

    /* skip everything created before startyear */

    If cryear < startyear Then Iterate

    If cryear == startyear Then Do

    crday = Right(SYSCREATE,3)

    /* skip everything created on or before specified afterday */

    If crday <= afterday Then Iterate

    End

    End
    IF LENGTH(SYSRECFM) > 1 THEN DO

    RECFM1 = SUBSTR(SYSRECFM,1,1)

    RECFM2 = SUBSTR(SYSRECFM,2,1)

    RECFM = RECFM1||' '||RECFM2

    END

    ELSE RECFM = SYSRECFM

    IF LENGTH(SYSRECFM) > 2 THEN Do

    RECFM3 = SUBSTR(SYSRECFM,3,1)

    RECFM = RECFM||' '||RECFM3

    END

    USED = ((SYSEXTENTS - 1) * SYSSECONDS) + SYSPRIMARY

    IF SYSDSORG == 'PO' THEN DIR = 'DSORG(PO) DSNTYPE(LIBRARY,2) +'

    IF SYSDSORG == 'DA' THEN DIR = 'DSORG(DA) +'

    IF SYSUNITS == 'BLOCK' THEN SYSUNITS = 'BLOCK('||SYSBLKSIZE||')'

    Say 'ALLOCATE DATASET('||DSN||') NEW +'

    Say 'UNIT('||SYSUNIT||') +'

    Say 'SPACE('||USED||','||SYSSECONDS||') '||SYSUNITS||' +'

    Say DIR

    Say 'RECFM('||RECFM||') +'

    Say 'LRECL('||SYSLRECL||') +'

    Say 'BLKSIZE('||SYSBLKSIZE||') +'

    Say 'CATALOG'
    Say 'FREE DATASET('||DSN||') KEEP'

    End

    exit 0

    CATLIST:

    PROCEDURE EXPOSE cat_dsn.

    ARG mask
    /* Set command environment to ISPEXEC */

    cmdenv = ADDRESS()

    "SUBCOM ISPEXEC"

    IF rc ¬= 0 THEN DO

    SAY "ISPF must be active to run this exec"

    EXIT 8

    END

    ADDRESS ISPEXEC

    i = 0

    /* Initialize data set list-ID */

    "LMDINIT LISTID(listid) LEVEL("mask")"

    IF rc ¬= 0 THEN DO

    SAY "LMDINIT error for '"mask"' - RC =" rc

    EXIT 16

    END

    dsn = ""
    /* Add each data set to list */

    DO WHILE rc = 0

    "LMDLIST LISTID("listid") OPTION(LIST) DATASET(dsn)"

    IF rc == 4 | rc == 8 THEN

    LEAVE

    IF rc ¬= 0 THEN DO

    SAY "LMDLIST error for '"mask"' - RC =" rc

    EXIT 16

    END

    cat_dsn.0 = cat_dsn.0 + 1

    i = i + 1

    cat_dsn.i = dsn

    END

    /*

    Free data set list-ID */

    "LMDFREE LISTID("listid")"
    IF rc ¬= 0 THEN DO

    SAY "LMDFREE error for '"mask"' - RC =" rc

    EXIT 16

    END

    /* Reset caller's command environment */

    ADDRESS VALUE cmdenv

    RETURN

    VSAM:

    ARG dsname

    If Right(dsname,5) == '.DATA' Then Return

    If Right(dsname,6) == '.INDEX' Then Return

    Say 'DEFINE CLUSTER (NAME('dsname') +'

    Say ' SHAREOPTIONS(3,3) +'

    Say ' STORAGECLASS(SCPRD01) MANAGEMENTCLASS(MCPR2201) +'

    Say ' DATACLASS(DCDEFALT) MODEL('dsname'))'

    RETURN