Previous Topic: Utility Maintenance Control StatementsNext Topic: Utility Report Control Statements


Sample Control Statements

Following are sample control statements of BACKUP, RESTORE, and REMOVE functions and an explanation of what they do.

BACKUP

 ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
 BACKUP    GROUPS=ALL

This BACKUP control statement backs up all queries, dialogs, terms, JCL and PROC members on the Query Library Table, provided that the user on the SIGN/ON statement has all blanks for the three group levels. Remember that DQLIBRMT does not backup conditions and restrictions.

Back up all of these members and restore them to a user ID with blank groups, for a backup source other than the system backups that your site performs.

 ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
 BACKUP    MEMBER=ACCTPRT,GROUPS=CAI,DALLAS,ACCT

This BACKUP control statement backs up the member name ACCTPRT with the assigned groups of CAI,DALLAS,ACCT. This is a selective backup and does not backup any other members.

RESTORE

 ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
 RESTORE   NAME=DAVIS,MEMBER=NATACCT,STATUS=PRIVATE

This RESTORE control statement restores the member name NATACCT with a status of PRIVATE from the input table, to the user ID DAVIS. This is a selective restore.

REMOVE

 ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
 REMOVE    DATE=01/01/92

This REMOVE control statement removes all members that were created prior to and not accessed since 01/01/92. This is a selective remove that can be performed if you want to remove members that have not been accessed in a long time.

QRYGRPS= Option

If the QRYGRPS= option on the System Option Table is YES, the user on the SIGN/ON statement is able to BACKUP, RESTORE, or REMOVE only those members that have the same groups.

If QRYGRPS=YES and DATE is used, CA Dataquery ignores the group assignment. If QRYGRPS=YES and NAME is used, the assignments are honored.

For example, User 1 has the groups DALLAS, DATACOM, DATAQUERY. The QRYGRPS= option is YES, so User 1 would only be able to access those members that had the same groups assigned to them. If User 1 had the groups DALLAS with Group Level 2 and Group Level 3 blank, all members with Group Level 1 DALLAS would be accessible no matter what Group Level 2 and Group Level 3 are.

If User 1 had group levels 1, 2 and 3 all blank, he could access any query for maintenance. You can RESTORE queries that belong to specific groups to a user ID that is not on the DQU table. Before executing the RESTORE, CA Dataquery assigns blank groups to this user when it checks the DQU table for this user. The blank groups make these queries available to all users or groups of users.

For example, there can be some CA Dataquery users who leave the company, who are in different groups and have written queries that you want the rest of the CA Dataquery users to access. If you RESTORE the queries of the users who have left the company to a new user ID with no groups specified, these queries now can be accessed by any CA Dataquery user.

Sample Job Stream

Following is an example of a report job stream:

SIGN/ON userid PASSWORD password
REPORT     TITLE=DIRECTORY
USER       NAME=SPECIALJOB
USER       NAME=VORTEX
REPORT     TITLE=QUERYTEXT,STATUS=PRIVATE
USER       NAME=EMPLOY
USER       NAME=ORTHO
USER       NAME=SAM

Note: If you do not supply a USER control statement, the reports reflect all of the users.

Following is an example of a maintenance job stream:

SIGN/ON userid PASSWORD password
RESTORE   NAME=OPERID,STATUS=PUBLIC
REMOVE    NAME=DEPARTED,MEMBER=QUERY2
BACKUP    NAME=OPERONE,MEMBER=SPECIAL,FILE=TAPE
BACKUP    NAME=OPERTEN,FILE=TAPE