OPS/MVS

 View Only
  • 1.  Backup an RDF table

    Posted Dec 22, 2021 04:17 PM
    I have created some panels to interface with one of our RDF tables to perform updates and additions.  My thought was to see if there is a backup of the table for the day, if not create one.   This would be on the same system.   I attempted to use SQL stmts to duplicate the current table and perform an INSERT INTO, but it appears that functionality is not available.

    address SQL
    "CREATE TABLE CHRIS_J21346 LIKE CHRIS"

    address SQL
    "INSERT INTO CHRIS_J21346 SELECT * FROM CHRIS"


    I am theorizing that if the same process can be performed in the RDF Table Editor, is it something that can be performed in REXX?

    I do know about the WRITETBL and READMAIL scripts, but was looking to see if there was a more direct process, where the datasets don't need to be cleaned up or external scripts run.

    Thank you for any assistance.
    Chris Allamon
    NFCU


  • 2.  RE: Backup an RDF table

    Broadcom Employee
    Posted Dec 23, 2021 04:08 AM
    Hi Chris.
    To me, LIKE predicades can be used in WHERE clauses. Probably not what you expected, but I'd use WRITETBL :
    /* REXX */
    /* BACKUP THE CHRIS TABLE */
    "oi writetbl table(CHRIS) DSNAME('SAVE.DATASET')"
    say rc
    /* RESTORE TO NEW TABLE */
    "oi readtbl table(CHRISNEW) DSNAME('SAVE.DATASET')"
    say rc

    Hope this helps anyway...


  • 3.  RE: Backup an RDF table

    Posted Dec 23, 2021 09:03 AM
    Thanks Mickael, the reason I am shying away from writetbl and readtbl is that security has gotten really tight and it is not as easy as it should be to allocate a dataset.  That's why I was looking for a SQL or command driven process.

    Thanks for the insight.

    Chris Allamon


  • 4.  RE: Backup an RDF table
    Best Answer

    Broadcom Employee
    Posted Dec 23, 2021 06:25 AM

    Hello Chris,

    You may consider using the ASOTEAPI program.
    For example, using the names from your original post:

    ADDRESS TSO
    "OI ASOTEAPI COPY TABLE(CHRIS) TARGET(CHRIS_J21346)"

    Reference in the OPS documentation:

    https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-ops-mvs-event-management-and-automation/14-0/reference/command-and-function-reference/relational-data-framework-reference/relational-table-editor-batch-api-functions.html

    Regards,

    Mario



    ------------------------------
    Carlos Mario Silveira Filho
    Principal Suppport Engineer/MSD
    Broadcom Software
    ------------------------------



  • 5.  RE: Backup an RDF table

    Posted Dec 23, 2021 09:08 AM
    Hello Carlos, thanks that is what I was looking for.   Another case of RTFM, and search on something other than the initials of the product.  I appreciate the assistance.

    Chris Allamon