Db2 Tools for zOS

Db2 Tools for z/OS

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  DB2 Query Management Facility/QMF for Workstation

    Posted Fri August 02, 2024 09:22 AM

    Hi,

    We are in the process of migrating several DB2 applications from one environment on one LPAR to another.  The only way to communicate between the LPARs is FTP.

    The applications have many hundreds of QMF procs, queries, forms etc.  We're aware of the export and import function available in QMF.  We have both the QMF for z/OS and QMF for Workstation.

    Is there an easy way to export a large number of QMF objects at once or do we need to do them one at a time?

    Thanks,

    Gloria Fries



    ------------------------------
    Gloria Fries
    ------------------------------


  • 2.  RE: DB2 Query Management Facility/QMF for Workstation

    Posted Mon August 05, 2024 09:50 AM

    Gloria,

     

    Are there enough objects that it's worth building a sequential file with EXPORT statements, another with FTP steps, a third with IMPORT? Or would that be harder than moving each by the traditional steps, one at a time?

     

    Exporting a lot of objects, short version:

     

    1. Using DSNTIAUL, you can write a series of EXPORT statements:

     

    SELECT CHAR(

                'EXPORT QUERY '
                CONCAT RTRIM(OWNER)

                CONCAT '.'

                CONCAT RTRIM(NAME)

                ,80

               )

    FROM Q.OBJECT_DIRECTORY

    WHERE ...

     

    • The all-encompassing CHAR function is required here. If you omit it, DSNTIAUL will write the record as a VARCHAR output, and the first (two?) bytes will be a binary value representing the length of the result row.

     

    1. These are the columns and properties in Q.OBJECT_DIRECTORY. You can use these in your predicate to pick the objects which you want to export.

     

    Q.OBJECT_DIRECTORY:

    Column Name        Col No Col Type Length

    ------------------ ------ -------- ------

    OWNER                   1 VARCHAR     128

    NAME                    2 VARCHAR     128

    TYPE                    3 CHAR          8

    SUBTYPE                 4 CHAR          8

    OBJECTLEVEL             5 INTEGER       4

    RESTRICTED              6 CHAR          1

    MODEL                   7 CHAR          8

    CREATED                 8 TIMESTMP     10

    MODIFIED                9 TIMESTMP     10

    LAST_USED              10 TIMESTMP     10

     

    ----

    This isn't by any means a complete solution; I've only written a sample query to show how DSNTIAUL can be used to create EXPORT statements in a sequential file.   Something like this for QMF has been on my "back burner" for a couple of years, and I've never had/taken the time to do it. 

     

    Please let me know if you find this helpful, or have further questions.  I'll answer as time permits! :-)

     

    /phil

     

     

     

    Philip Sevetson

    Computer Systems Manager

    FISA-OPA

    5 Manhattan West

    New York, NY 10001

    psevetson@fisa-opa.nyc.gov

    917-991-7052 (m)

     

     






  • 3.  RE: DB2 Query Management Facility/QMF for Workstation

    Posted Tue August 06, 2024 01:26 PM

    Hi Gloria

    As Prasad mentioned, QMF for Workstation is going to have a utility coming out to address bulk migrations of QMF objects in an upcoming release.  We hope to have a similar tool for QMF for TSO in the future.

    I wanted to expand on Wesley's method a bit with a little beware and workaround. I was not clear if the target QMF had existing QMF objects already in the catalog. If so, just be careful with the SAVE DATA defaults as that will overwrite your existing QMF catalog objects.  Here is a similar method that I have given to users over the years which will not overwrite any existing QMF objects in the target server. For this case, the users had QMF objects in the target and wanted to bring a bunch of new QMF objects into the existing catalog.

    As everyone has mentioned, it takes the info in the 3 QMF catalog tables Q.OBJECT_DATA, Q.OBJECT_REMARKS and Q.OBJECT_DIRECTORY to complete the definition of a QMF object. So you can figure out your object requirements (by owner or name) and run your SELECTs in the source:

    SELECT * FROM Q.OBJECT_REMARKS

    WHERE OWNER IN ('QMF','RZALUD','TS5519')  

    Then run the command:

    EXPORT DATA TO OBJREM

    Run your next query:

    SELECT * FROM Q.OBJECT_DATA

    WHERE OWNER IN ('QMF','RZALUD','TS5519')  

    EXPORT DATA TO OBJDATA

    And then:

    SELECT * FROM Q.OBJECT_DIRECTORY

    WHERE OWNER IN ('QMF','RZALUD','TS5519')  

    EXPORT DATA TO OBJDIR

    Sent your 3 exported files to the target. Go into the target QMF and then do:

    IMPORT TABLE Q.OBJECT_DIRECTORY
    + FROM 'xyz.OBJDIR' (ACTION=APPEND
    IMPORT TABLE Q.OBJECT_DATA
    + FROM 'xyz.OBJDAT' (ACTION=APPEND
    IMPORT TABLE Q.OBJECT_REMARKS
    + FROM 'xyz.OBJREM' (ACTION=APPEND

    The ACTION=APPEND is crucial as to not wipe out your existing QMF catalog. (It takes the place of the 2 steps of IMPORT DATA/SAVE DATA.) 



    ------------------------------
    Robin Zalud
    Senior Software Engineer
    Rocket Software
    rzalud@rocketsoftware.com
    ------------------------------



  • 4.  RE: DB2 Query Management Facility/QMF for Workstation

    Posted Tue August 06, 2024 07:21 AM
    Edited by Prasad Pawar Tue August 06, 2024 07:30 AM

    Hi Gloria,

    This is a really interesting use case. I want to let you know that our R&D team is working on a functionality to simplify the migration of bulk QMF objects from one QMF Catalog to another or to a repository workspace. This functionality will most likely be available in the coming release.



    ------------------------------
    Prasad Pawar

    Rocket Software
    ------------------------------



  • 5.  RE: DB2 Query Management Facility/QMF for Workstation

    Posted Tue August 06, 2024 11:05 AM

    Hi Gloria,

    the definitions for objects on QMF for z/OS are held on the following tables:

    Q.OBJECT_DIRECTORY

    Q.OBJECT_DATA

    Q.OBJECT_REMARKS 

     You could export these tables, send the export files to the new server via FTP and import them on your new server.  You will need insert authority on the Q tables obviously.  e.g.

    SELECT * FROM Q.DIRECTORY --WHERE OWNER = 'CS000WA';

    EXPORT DATA TO QDIR

    ......

    IMPORT DATA FROM QDIR 

    SAVE DATA AS OBJECT_DIR 

    INSERT INTO Q.OBJECT_DIRECTORY (SELECT * FROM OBJECT_DIR WHERE .......) 

     



    ------------------------------
    Wesley Alsop
    ------------------------------



  • 6.  RE: DB2 Query Management Facility/QMF for Workstation

    Posted Wed August 07, 2024 03:15 PM

    I have two jobs I created to UNLOAD and LOAD QMF queries/procs/forms utilizing DSNUTILB and FTP if needing to move to a different sysplex/LPAR.  I've also used the jobs to unload someone's QMF objects and then I change the owner to another ID in the unload files and then reload back (cloning to someone else).   See attached text files (QMFLOAD / QMFUNLD).  



    ------------------------------
    Grant Hale
    ------------------------------

    Attachment(s)

    txt
    QMFLOAD.txt   27 KB 1 version
    txt
    QMFUNLD.txt   16 KB 1 version