B97BUTLT reads data from a sequential dataset and inserts, updates, or deletes appropriate records in the Adabas Audit Data Retrieval database.
You can find a tailored JCL for this utility in the BETA97.CNTL in member B97BUTLT.
Use DD SYSIN to specify which data should be inserted, updated, or deleted. The record format of the DD SYSIN dataset must be fixed.
The corresponding download utility is B97DLOAD. For example, you can download definitions from an Adabas Audit Data Retrieval database by using B97DLOAD and then upload this data into another Adabas Audit Data Retrieval database using B97BUTLT. To do this, specify the output dataset created by B97DLOAD (DD IRMPRINT) as input dataset of B97BUTLT (DD SYSIN).
Changes in the Adabas Audit Data Retrieval database are logged in SMF records of subtype 51 if the writing of these records has been activated.
A BUTLT statement that inserts a new record consists of the command INSERT TABLE tablename, which is followed by the name-value pairs for the fields of the record:
INSERT TABLE tablename
field_1 = "value"
field_2 = "value"
field_n = "value"
Each name-value pair (fieldname = "value") must be on a separate line. The INSERT keyword is optional and may be omitted.
TABLE tablename
field_1 = "value"
field_2 = "value"
field_n = "value"
A BUTLT statement that deletes one or more records consists of the command DELETE TABLE tablename, which is followed by a WHERE condition:
DELETE TABLE tablename
WHERE
field_a operator "value" [AND|OR field_b operator "value" ...]
The WHERE condition contains one expression (fieldname operator "value") or several AND/OR connected expressions, which control the selection of the records that are to be deleted.
A BUTLT statement that updates one or more records consists of the command UPDATE TABLE tablename, which is followed by one or several name-value pairs and a WHERE condition:
UPDATE TABLE tablename
field_1 = "value"
field_2 = "value"
field_n = "value"
WHERE
field_a operator "value" [AND|OR field_b operator "value" ...]
Each name-value pair (fieldname = "value") must be on a separate line.
The WHERE condition contains one expression (fieldname operator "value") or several AND/OR connected expressions, which control the selection of the records that are to be updated.
The following rules apply to all BUTLT statements (INSERT, UPDATE, and DELETE):
The following applies to name-value pairs:
The following applies to WHERE conditions:
+------------------------------------------------------------------------+
|UPDATE TABLE LDR |
| LTITLE = "THIS IS THE " - |
| "NEW TITLE OF MY LIST" |
|WHERE |
| FORM EQ "REJ" AND |
| EXT EQ "TRADE" |
+------------------------------------------------------------------------+
The values of BYTE and FLAG fields must be specified using the external format. The corresponding language-dependent values must be specified in English.
Use the database dictionary (Option D.2) to find out about legal values.
Operator |
Function |
---|---|
EQ or = or == |
equal |
LIKE |
like (interprets % and * as wildcards) |
NE or ^= |
not equal to |
UNLIKE |
unlike (interprets % and * as wildcards) |
GT or > |
greater than |
GE or >= |
greater than or equal to |
LT or < |
less than |
LE or <= |
less than or equal to |
AND |
Boolean AND |
OR |
Boolean OR |
IN |
May be used as abbreviated form for OR connection if the field name is identical This statement: field IN (value1,value2) is equivalent to: field EQ value1 OR |
Following are the corresponding values for the Line No. field, which is used in index definitions (IDXOVLN) and search argument definitions (SASOVLN):
This value ... |
Corresponds to ... |
---|---|
0 |
MERGE |
n |
line number n |
32768 |
ANY |
65535 |
LAST |
You can use CONTROL statements in DD SYSIN to control the program behavior of B97BUTLT, for example:
Normally, the CONTROL statement is placed at the beginning of DD SYSIN.
CONTROL statements must use the following syntax:
*V--+----1=-V-+----2----+
keyword = value
By default, the batch utility B97BUTLT logs in DD IRMLOG all statements that lead to an error and the accompanying error messages.
Use the CONTROL statement PROTOCOL = ALL to log all statements in DD IRMLOG, including those ending with RC=0.
*V--+----1=-V-+----2----+
CONTROL START
PROTOCOL = ALL
CONTROL END
The fields CDATE, CTIME, and CUSER contain the date, time, and user ID of the last modification of the record. By default, these fields are updated by B97BUTLT when inserting a new record. This means that the CDATE, DTIME, and CUSER fields of an uploaded record refer to the modification of the record by B97BUTLT.
When uploading records (INSERT) use the CONTROL statement CHG_INFO = OLD, if the values uploaded to these fields are to be preserved.
*V--+----1=-V-+----2----+
CONTROL START
CHG_INFO = OLD
CONTROL END
DATEMASK = mask specifies the date format that is used in the BUTLT statements. Legal values are the date formats that are supported by BSA (see online option P.2).
Specifying DATEMASK is required only in the following cases:
Specifying DATEMASK is not required when:
*V--+----1=-V-+----2----+
CONTROL START
DATEMASK = YYYY-MM-DD
CONTROL END
Coding the CONTROL statement PROCESS = AUTOUPD causes the following program behavior during INSERT: If inserting a new record fails because a record is already present under this key (BQL infocode 142 - Duplicate key), the program will automatically branch into UPDATE mode and update the corresponding record.
*V--+----1=-V-+----2----+
CONTROL START
PROCESS = AUTOUPD
CONTROL END
Autoupdate requirements and limitations:
By default, the occurrence of BQL infocode 142 leads to B97BUTLT ending with RC=20. (BQL infocode 142 (Duplicate key) means: Insertion has failed because a record with the same key already exists.) You can use RC_KDUPL to define a different return code for this error case. Legal values are:
RC_KDUPL = OKAY (corresponds to RC=0)
RC_KDUPL = WARNING (corresponds to RC=4)
RC_KDUPL = ERROR (corresponds to RC=8)
Notes:
RC_KDUPL = level cannot be used in combination with PROCESS = AUTOUPD. If both are coded, RC_KDUPL = level will be ignored.
RC_KDUPL takes effect only if BQL infocode 142 is the only error that occurred during the insertion of records. If other errors have occurred in addition to or instead of BQL infocode 142, RC_KDUPL = level has no effect, and the program will end with RC=20.
*V--+----1=-V-+----2----+
CONTROL START
RC_KDUPL = level
CONTROL END
0 |
The program terminated normally. |
4 |
The program did not find any data to be inserted, updated, or deleted; the program terminated normally. |
20 |
One of the following errors occurred:
Check DD IRMLOG to find out what caused the error. |
24 |
The subsystem is not available. |
32 |
One of the following errors occurred:
|
DD IRMLOG contains a summary activity log.
DD IRMLOG also logs all definitions that lead to an error. You can edit and then reuse this log as input for B97BUTLT. The program will ignore all messages in the log.
+---------------------------------------------------------------------------------------------------------+
|IRM1561I PROGRAM: B97BUTLT VERSION: V7R2M00 PTFLVL: ptflvl COMPILED: date,time |
|IRM4000I B97BUTLT UPLOAD UTILITY STARTED - DATE: date, TIME: time |
|IRM4100I ************************************************************************************* |
|IRM4008I ADMINISTRATOR SECURITY LEVEL SET FOR USER B97ADM |
|IRM4100I ------------------------------------------------------------------------------------- |
|UPDATE TABLE SYS |
| SYSTITLE = "THIS IS THE NEW TITLE OF MY DEFINITION " - |
| "BUT IF TOO LONG IT WILL LEAD TO A VALUE CONVERSION ERROR" |
|WHERE |
| SSID EQ "B97P" |
|IRM3566E - 6 VALUE CONVERSION ERROR - VALUE OF FIELD SYSTITLE COULD NOT BE CONVERTED TO INTERNAL FORMAT|
|IRM4003E COMMAND ERROR RC( 20) |
|IRM4100I ------------------------------------------------------------------------------------- |
|IRM4998I 1 SYS - COMMANDS PROCESSED (IN ERROR: 1) |
|IRM4998I 1 total - COMMANDS PROCESSED (IN ERROR: 1) |
|IRM4100I ************************************************************************************* |
|IRM4999I B97BUTLT UPLOAD UTILITY ENDED - DATE: date, TIME: time, RC: 0020 |
+---------------------------------------------------------------------------------------------------------+
Following the standard security check for the BUE function, the ADM authorization (profile B97.ssid.ADM) of the submitting user is checked. If the user has the access authorization ACCESS=READ, the specified INSERT, UPDATE and DELETE commands are carried out without individual security check. If the user does not have this authorization, the authorization is checked before each individual command.
Modifying the table IGR requires that the submitter has ADM authorization and that the started task is stopped (SIGNON=NO).