Previous Topic

Next Topic

Book Contents

Book Index

Work Flow of the CTDUFUPD Utility

The utility reads the SELECT and CHANGE TO or DELETE control statements. For each file name defined in the FILE statement, the utility finds the records that meet the selection criteria and updates or deletes each selected record based on the CHANGE TO or DELETE control statement.

If the PRINT parameter is set to DETAILS, each selected record is written to the file referenced by DD statement PRINTDET. If CHANGE TO is specified, updated records are written to the same file so that changes to the records can be seen.

If the WRITE_TO_FILE parameter is used, all the selectable fields of either the selected primary or default USER records are written to the file referenced by DD statement WR2FILE. These fields are written without delimiters. The full source record key (that is, the concatenation of the VSAUSER, VSAXKEY, and VSACOUNT fields) and the letter designating the corresponding User Report List file are appended to the file referenced by WR2FILE. Table 266 describes the VSAUSER, VSAXKEY, and VSACOUNT fields:

Table 266 CTDUFUPD Control Statement Fields

Field Name

Length

Description

VSAUSER

8

Name of the user                    

VSAXKEY

8

Job or beginning of report name or beginning of category

VSACOUNT

8

Timestamp of record creation        

Instead of specifying selection criteria, you can optionally use the USERFILE parameter to specify a file that contains the USER values of source records to be changed or deleted.

Other selection criteria used in conjunction with parameter USERFILE are processed together with the set of USER values contained in the file referenced by DD statement specified in parameter USERFILE.

For example:

USERFILE=USFILEDD

USER=N52*

In this case, only records whose USER field starts with N52 and belong to the set of records identified in the file referenced by DD statement USFILEDD are selected.

The USERFILE parameter enables you to select a set of records that cannot be easily selected using selection criteria. For example, using the WRITE_TO_FILE parameter, you can create one list of users from the Permanent User file and a second list of users from the Active User file. You can then combine these two lists, using system tools, to prepare a file of USER values that exist in the Permanent User file, but not in the Active User file. This file of USER values can then be used with the USERFILE parameter to delete unneeded records from the Permanent User file.

You can also use the USERFILE parameter to switch the first specified USER values with the second specified values in the specified User Report files. The corresponding pairs of USER values must be specified consecutively, without delimiters, for each record in the data set referenced by the USERFILE parameter. These pairs must be located at the beginning of each record.

Figure 98 CTDUFUPD – Example 1

//UPDATE   EXEC CTDUFUPD

//SYSIN  DD *  

SELECT         

  FILE=ACT     

  USER=USER1*  

  DEC_TIME = 0725

  PRINT=DETAILS

//

In this example, the utility selects Active User file records whose USER field starts with USER1 and whose decollation date is 25 July 2000. All the selected records are written to the file referenced by DD statement PRINTDET.

Figure 99 CTDUFUPD – Example 2

//UPDATE   EXEC CTDUFUPD

//SYSIN  DD *  

SELECT         

  FILE = ACT     

  USER = USER1*  

  USER = USER3*  

  DEC_TIME = 0717 - 0816

  PRINT = DETAILS

  SIMULATE = NO

CHANGE TO

  USER = BMCU????

//

In this example, the utility selects Active User file records where the USER field value begins with USER1 or USER3 and the decollation date is between 17 July 2000 and 16 August 2000. In the selected records, field USER is updated by changing the first 4 characters to BMCU and not changing the remaining characters.

Because SIMULATE is set to NO, records are actually updated.

Figure 100 CTDUFUPD – Example 3

//UPDATE   EXEC CTDUFUPD

//SYSIN  DD *  

SELECT         

  FILE = ACT     

  USER = USER5*  

  DEC_TIME = 071700 – 081600

  ODATE =

  PRINT = DETAILS

  SIMULATE = NO

DELETE

//

In this example, the utility selects Active User file records where the value of field USER begins with USER5, the decollation date is between 17 July 2000 and 16 August 2000, and the ODATE field is blank. All the selected records are deleted from the Active User file.

Parent Topic

CTDUFUPD – Global Scan or Change of User Files