It is sometimes necessary to reassign or transfer a Dataquery user's queries to another person. If there are only a few, it can easily be done online. However, if there are many, it is much easier to do this in a batch process. This article explains a process to do that.
This process will provide a job that will
In order to rename the owner of these queries, take a backup of the queries for the "From" user, remove the "From" user queries, and then restore the backup to the "To" user. The only thing to be aware of is if your "To" user already has queries with the same member name, you have to manage that beforehand. If you want to replace that member with the one from the backup, then you would have to delete the "To" user version or rename it manually before running this job.
We recommend that you take a DBUTLTY backup of the DQQ area before running this process.
Here is a sample JCL member that you can use (it is attached to this article, also).
//DQLIBJOB JOBCARD
//*
//* -----------------------------------------------------------------7-
//*
// EXPORT SYMLIST=(*) <- DO NOT REMOVE THIS
//*
//* -----------------------------------------------------------------7-
//* Change the following SET parameters as indicated
//* -----------------------------------------------------------------7-
//*
//* Dataquery "From" and "To" users
// SET NAMEF=ffffffff,NAMET=tttttttt
//*
//* Filename for the Dataquery backup of the "From" user queries
// SET DQBKP=your.query.backup.file
//*
//* Process which "From" user queries for Backup and Restore?
// SET BKSTAT=ALL Backup ALL, PUBLIC, or PRIVATE?
// SET RSSTAT=ALL Restore ALL, PUBLIC, or PRIVATE?
//*
//* Select one of these for the backup file storage
//* SET BKPSTO='UNIT=3390,VOL=SER=VVVVVV'
//* SET BKPSTO='MGMTCLAS=MMMMMMMM,STORCLAS=SSSSSSSS,DATACLAS=DDDDDDDD'
//*
//* How much SPACE for the backup file?
// SET BKPSPC='SPACE=(CYL,(200,20),RLSE)'
//*
//* Specify the Dataquery LOGIN and PASSWORD
// SET DQLOGIN=DATACOM-INSTALL,DQPASS=NEWUSER
//*
//* Enter the loadlibs for the Datacom MUF and for IPC
// SET BDCUS=your.datacom.DB.CUSLIB
// SET BDLOD=your.datacom.DB.CABDLOAD
// SET VQLOD=your.IPC.CAVQLOAD
//*
//* -----------------------------------------------------------------7-
//* NO NEED TO MAKE ANY CHANGES BELOW THIS LINE
//* -----------------------------------------------------------------7-
//*
//*==================================================================*
//* DQLIB S T A R T O F P R O C *
//DQLIB PROC
//DQLIBRMT EXEC PGM=DQLIBRMT,REGION=4M
//STEPLIB DD DISP=SHR,DSN=&BDCUS
// DD DISP=SHR,DSN=&BDLOD
// DD DISP=SHR,DSN=&VQLOD
//SYSPRINT DD SYSOUT=*
//SNAPER DD SYSOUT=*
//DQLIB PEND
//* DQLIB E N D O F P R O C *
//*==================================================================*
//*
//* ------------------------------------------------------------------
//* Step Name - @01DELET - Execute PGM - IDCAMS -
//* Function - Delete the Dataquery backup if it exists -
//* -----------C------------------------------------------------------
//@01DELET EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=(JCLONLY)
DELETE &DQBKP SCRATCH
SET MAXCC=0
/*
//*
//@01IF IF @01DELET.RC = 0 THEN
//*
//* ------------------------------------------------------------------
//* Step Name - @02BAKUP - Execute PROC - DQLIB -
//* Function - Backup the "From" user's Queries -
//* -----------C------------------------------------------------------
//@02BAKUP EXEC PROC=DQLIB,REGION=4M
//DQBKPFIL DD DISP=(,CATLG,DELETE),DSN=&DQBKP,
// &BKPSTO,
// &BKPSPC
//SYSIN DD *,SYMBOLS=(JCLONLY)
SIGN/ON &DQLOGIN PASSWORD &DQPASS
BACKUP NAME=&NAMEF,TYPE=QUERY,STATUS=&BKSTAT
/*
//*
//@02IF IF @02BAKUP.DQLIBRMT.RC = 0 THEN
//*
//* ------------------------------------------------------------------
//* Step Name - @03REMOV - Execute PROC - DQLIB -
//* Function - Remove all queries for the "From" user -
//* -----------C------------------------------------------------------
//@03REMOV EXEC PROC=DQLIB,REGION=4M
//SYSIN DD *,SYMBOLS=(JCLONLY)
SIGN/ON &DQLOGIN PASSWORD &DQPASS
REMOVE NAME=&NAMEF,TYPE=QUERY
/*
//*
//* ------------------------------------------------------------------
//* Step Name - @04RESTR - Execute PROC - DQLIB -
//* Function - Restore backed up queries to the "To" user -
//* - Produce directory of members for both users -
//* -----------C------------------------------------------------------
//@04RESTR EXEC PROC=DQLIB,REGION=4M
//DQRSTFIL DD DISP=SHR,DSN=&DQBKP
//SYSIN DD *,SYMBOLS=(JCLONLY)
SIGN/ON &DQLOGIN PASSWORD &DQPASS
RESTORE NAME=&NAMET,STATUS=&RSSTAT
REPORT TITLE=DIRECTORY
USER NAME=&NAMEF
USER NAME=&NAMET
/*
//* ------------------------------------------------------------------
//*
//@02END ENDIF
//*
//@01END ENDIF
//
For more information about Dataquery Library Management, please review the documentation webpage titled "Managing Your Query Library Table" and specifically, the section on that page titled "Performing Query Table Maintenance (DQLIBRMT)."
As always, please contact Broadcom support for Datacom if you have further questions.