Run HDDL line command in Batch using an Alternate Catalog within RC/Query
search cancel

Run HDDL line command in Batch using an Alternate Catalog within RC/Query

book

Article ID: 257825

calendar_today

Updated On:

Products

RC/Query for DB2 for z/OS

Issue/Introduction

Run HDDL line command in Batch using an Alternate Catalog within RC/Query for Db2 for z/OS (RCQ).

Resolution

1. Set your Alternate catalog 

On the main menu turn on and reference the ACM

20.0.06  Database Management Solutions for Db2 for z/OS       yyyy/mm/dd hh:mm
OPTION ===>                                                   SCROLL ===> CSR

DB2 SSID ==> ssid LOCATION ==> LOCAL                   DB2 VERSION: V12R1M500
ACM      ==> ON   ACMID    ==> ACMNEW   SQLID ==> authid1



2. Go to RC/Query and select the object and enter the HDDL line command.

RQDBL         ------------- RC/Q Data Base List ------------- yyyy/mm/dd hh:mm
COMMAND ===>                                                  SCROLL ===> CSR

 DB2 Object ===> DB                      Option  ===> L    Where => N
Data Base ===> dbname              > Creator ===> authid1                >
  Qualifier ===> *                     > N/A     ===> *                      >
Loc: LOCAL ---------- SSID: ssid ----------authid1 -          LINE 1 OF 1    >
CMD      DATABASE CREATOR  STOGROUP   DBID BPOOL    INDEXBP  IMP REL TYPE
HDDL____ dbname authid1  stogroup  nnnn BP32K    BP2      N   Q
******************************* BOTTOM OF DATA ********************************


3. Select the dependent objects and output dataset

--------------- RC/Query Hierarchical DDL Request Options ---------------

                                                              More:     +
On Object: Type DB Name dbname

  Execution Specifications:                 RI Chain Setting:
    Mode . . B ( O - Online, B - Batch )      RI Chain . . Y  (Y or N)

  Batch Output Library:       SPUFI options Setting:
    Project . . authid1       SPUFI Compatible . . . N  (Y or N)
    Group . . . MLQ           Object Selection:
    Type  . . . BPCODE        SG DB TS T  I  V  S  A  TG R  SQ PM
    Member  . .                  Y  Y  Y  Y  Y  Y  Y  Y  Y  Y  Y

  Other Partitioned or Sequential File:
    Name . . . . . authid1.MLQ.HDDLOUT
    Volume Serial . .        (If not cataloged)

The dataset must have a DCB of FB, LREL 80.
If it does not exist yet, the JCL will create it for you.

The generated JCL looks like this:

//job card
//*
//HDDLSTEP EXEC PGM=PTLDRIVM,REGION=0M,
//             PARM='SUFFIX=00,EP=PTLHDDLB'
//STEPLIB  DD DISP=SHR,DSN=hlq.CDBALOAD
//         DD DISP=SHR,DSN=hlq.SDSNEXIT
//         DD DISP=SHR,DSN=hlq.SDSNLOAD
//PTILIB   DD DISP=SHR,DSN=hlq.CDBALOAD
//         DD DISP=SHR,DSN=hlq.SDSNEXIT
//         DD DISP=SHR,DSN=hlq.SDSNLOAD
//PTIPARM  DD DISP=SHR,DSN=hlq.CDBAPARM
//HDDLOUT  DD DSN=authid1.MLQ.HDDLOUT,                   <-----new output dataset being created! 
//         DISP=(NEW,CATLG,DELETE),
//         SPACE=(CYL,(1,1),RLSE)
//SYSPRINT DD SYSOUT=*
//MSGFILE  DD SYSOUT=*
//ABNLIGNR DD DUMMY                 SUPPRESS ABENDAID DUMPS
//PARMFILE DD *
SSID ssid
LOCATION LOCAL
ACMID ACMNEW           <---------------here is the ACM you turned on above
SQLID authid1
OBJTYPE DB
NAME "dbname"
SQLDLIM ;
SPUFIIND N
OBJECTS NYYYYYYYYYYY
OWNERIND N
RICHAIN  Y
GENGRANT N
/*
//

The output dataset authid1.MLQ.HDDLOUT will contain the DDL of the objects selected and dependents as requested on the screen.

As this example was run using the "SPUFI Compatible . . . N" setting, it can only be run using BATCH PROCESSOR as it has BATCH PROCESSOR commands in it.
If, however "SPUFI Compatible . . . Y" is used before execution of the batch job, the DDL will be generated WITHOUT any BATCH PROCESSOR commands such
as .CONNECT so that it can be executed by any SQL processing program like SPUFI or DSNTEP2 for instance.

Additional Information

Generate Hierarchical Object DDL