SMF records of subtype 51 are written to record modifications of the definitions in the Adabas Audit Data Retrieval definition. An SMF record of this type is written each time when a record in the corresponding database tables is inserted, updated or deleted.
Adabas Audit Data Retrieval does not write SMF records of subtype 51 for the following database tables: AOR, GBL, IAR, IGL, IGR, IGS, MSG, OGR, RLD, SFR, and UGF
These field descriptions (relative offsets) are also available in:
BETA97.SAMPLIB(§97S051R)
Subtype 51
SMF record subtype 51
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
76 |
S051RES0 |
9 |
X |
Reserved for future use |
85 |
S051FLAG1 |
1 |
F |
Flag field X'01' Modification level 1 |
86 |
S051RES1 |
3 |
X |
Reserved for future use |
89 |
S051REQ |
1 |
C |
Type of modification: |
90 |
S051TABLE |
8 |
C |
Table name |
98 |
S051USER |
8 |
C |
User ID |
106 |
S051RDATE |
4 |
D |
Date of request |
110 |
S051RTIME |
4 |
Z |
Time of request |
114 |
S051FNUM |
2 |
B |
Number of fields in the database record |
116 |
S051RLEN |
4 |
B |
Length of SMF record |
120 |
S051DLEN |
4 |
B |
Length of data area |
124 |
S051VLEN |
2 |
B |
Length of value area |
126 |
S051TLEN |
2 |
B |
Length of one table value area |
128 |
S051ELEN |
2 |
B |
Length of field element |
130 |
S051EPOS |
2 |
B |
Pointer to field element area |
132 |
S051STCK |
8 |
X |
Timestamp (STCK) |
140 |
S051LCMD |
2 |
C |
Line command |
142 |
S051RPOS |
2 |
B |
Pointer to value area |
144 |
S051RES2 |
6 |
X |
Reserved for future use |
The field element area contains one field element for each field of the database record. Each field element contains information on the database field and the offset(s) of the value element(s) in the value area. S051FNUM indicates the number of field elements.
Offsets are relative to the start of the field element. The start of each field element (s) can be calculated using this formula:
s = S051EPOS + S051ELEN * (n - 1)
where S051EPOS is the start of the field element area, S051ELEN the length of the field element, and n the number of the field (1..S051FNUM).
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
s+0 |
S051FNAME |
8 |
C |
Field name |
s+8 |
S051FTYP |
1 |
C |
Field type on database (see also "Field formats for subtype 51" in _beta smf Manual) |
s+9 |
S051FLAG |
1 |
X |
Control flag |
s+10 |
S051FLEN |
4 |
B |
Field length |
s+14 |
S051FPOS |
4 |
B |
Offset in value area (insert, delete, update_old) |
s+18 |
S051FPOSN |
4 |
B |
Offset in value area (update_new) |
s+22 |
S051FRES |
8 |
X |
Reserved for future use |
The value area follows the field element area.
If insert:
The value area contains one value field for each field of the database record. The corresponding field element contains the information on length (S051FLEN), format (S051FTYP), and offset (S051FPOS) relative to the start of the value area (S051RPOS).
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
off |
Q051field1 |
len |
fmt |
Value of field1 |
off |
Q051field2 |
len |
fmt |
Value of field2 |
... |
... |
... |
... |
... |
off |
Q051fieldn |
len |
fmt |
Value of fieldn |
If delete:
The value area contains one value field for each field of the database record. The corresponding field element contains the information on length (S051FLEN), format (S051FTYP), and offset (S051FPOS) relative to the start of the value area (S051RPOS).
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
off |
P051field1 |
len |
fmt |
Value of field1 |
off |
P051field2 |
len |
fmt |
Value of field2 |
... |
... |
... |
... |
... |
off |
P051fieldn |
len |
fmt |
Value of fieldn |
If update:
The value area contains two value fields for each field of the database record. The corresponding field element contains the information on length (S051FLEN), format (S051FTYP), offset_old (S051FPOS), and offset_new (S051FPOSN). Offsets are relative to the start of the value area (S051RPOS). All fields of the database record are included in the SMF record, irrespective of whether they were changed or not.
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
off |
O051field1 |
len |
fmt |
Old value of field1 |
off |
O051field2 |
len |
fmt |
Old value of field2 |
... |
... |
... |
... |
... |
off |
O051fieldn |
len |
fmt |
Old value of fieldn |
off |
N051field1 |
len |
fmt |
New value of field1 |
off |
N051field2 |
len |
fmt |
New value of field2 |
... |
... |
... |
... |
... |
off |
N051fieldn |
len |
fmt |
New value of fieldn |
The following example uses a hypothetical three-field table to illustrate the structure of this type of SMF record: FIELD1 (8 char), FIELD2 (16 char), and FIELD3 (16 char).
The indicated offset value of the fields S051FNUM through S051RPOS is relative from the start of the BETA header. The offsets of the other fields are relative to the start of the field element area epos (S051EPOS) and the value area rpos (S051RPOS).
The following fields are written when a definition is inserted:
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
... |
... |
... |
... |
... |
114 |
S051FNUM |
2 |
B |
Number of field elements (In example: 3) |
116 |
S051RLEN |
4 |
B |
Length of SMF record |
120 |
S051DLEN |
4 |
B |
Length of data area |
124 |
S051VLEN |
2 |
B |
Length of value area |
126 |
S051TLEN |
2 |
B |
Length of one table value area |
128 |
S051ELEN |
2 |
B |
Length of one field element (Currently 30) |
130 |
S051EPOS |
2 |
B |
Offset of field element area in SMF record (i.e. position of first S051FNAME field) |
... |
... |
... |
... |
... |
142 |
S051RPOS |
2 |
B |
Offset of value area in SMF record (i.e. position of first Q051xxxxx field) |
... |
... |
... |
... |
... |
epos |
S051FNAME.. |
30 |
various |
Information on FIELD1 (S051FPOS shows offset of Q051FIELD1 in value area) |
epos+30 |
S051FNAME.. |
30 |
various |
Information on FIELD2 (S051FPOS shows offset of Q051FIELD2 in value area) |
epos+60 |
S051FNAME.. |
30 |
various |
Information on FIELD3 (S051FPOS shows offset of Q051FIELD3 in value area) |
rpos+0 |
Q051FIELD1 |
8 |
C |
Value of FIELD1 |
rpos+8 |
Q051FIELD2 |
16 |
C |
Value of FIELD2 |
rpos+24 |
Q051FIELD3 |
16 |
C |
Value of FIELD3 |
The following fields are written when a definition is deleted:
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
... |
... |
... |
... |
... |
114 |
S051FNUM |
2 |
B |
Number of field elements (In example: 3) |
116 |
S051RLEN |
4 |
B |
Length of SMF record |
120 |
S051DLEN |
4 |
B |
Length of data area |
124 |
S051VLEN |
2 |
B |
|
126 |
S051TLEN |
2 |
B |
Length of one table value area |
128 |
S051ELEN |
2 |
B |
Length of field element (Currently 30) |
130 |
S051EPOS |
2 |
B |
Offset of field element area in SMF record (i.e. position of first S051FNAME field) |
... |
... |
... |
... |
... |
142 |
S051RPOS |
2 |
B |
Offset of value area in SMF record (i.e. position of first P051xxxxx field) |
... |
... |
... |
... |
... |
epos |
S051FNAME.. |
30 |
various |
Information on FIELD1 (S051FPOS shows offset of P051FIELD1 in value area) |
epos+30 |
S051FNAME.. |
30 |
various |
Information on FIELD2 (S051FPOS shows offset of P051FIELD2 in value area) |
epos+60 |
S051FNAME.. |
30 |
various |
Information on FIELD3 (S051FPOS shows offset of P051FIELD3 in value area) |
rpos |
P051FIELD1 |
8 |
C |
Value of FIELD1 |
rpos+8 |
P051FIELD2 |
16 |
C |
Value of FIELD2 |
rpos+24 |
P051FIELD3 |
16 |
C |
Value of FIELD3 |
The following fields are written when a definition is updated:
Offset |
Name |
Length |
Format |
Description |
---|---|---|---|---|
... |
... |
... |
... |
... |
114 |
S051FNUM |
2 |
B |
Number of field elements (In example: 3) |
116 |
S051RLEN |
4 |
B |
Length of SMF record |
120 |
S051DLEN |
4 |
B |
Length of data area |
124 |
S051VLEN |
2 |
B |
Length of value area |
126 |
S051TLEN |
2 |
B |
Length of one table value area |
128 |
S051ELEN |
2 |
B |
Length of field element (Currently 30) |
130 |
S051EPOS |
2 |
B |
Offset of field element area in SMF record (i.e. position of first S051FNAME field) |
... |
... |
... |
... |
... |
142 |
S051RPOS |
2 |
B |
Offset of value area in SMF record (i.e. position of first O051xxxxx field) |
... |
... |
... |
... |
... |
epos |
S051FNAME.. |
30 |
various |
Information on FIELD1 (S051FPOS and S051FPOSN show offset of O051FIELD1 and N051FIELD1 in value area) |
epos+30 |
S051FNAME.. |
30 |
various |
Information on FIELD2 (S051FPOS and S051FPOSN show offset of O051FIELD2 and N051FIELD2 in value area) |
epos+60 |
S051FNAME.. |
30 |
various |
Information on FIELD3 (S051FPOS and S051FPOSN show offset of O051FIELD3 and N051FIELD3 in value area) |
rpos |
O051FIELD1 |
8 |
C |
Value of FIELD1 before the modification |
rpos+8 |
O051FIELD2 |
16 |
C |
Value of FIELD2 before the modification |
rpos+24 |
O051FIELD3 |
16 |
C |
Value of FIELD3 before the modification |
rpos+tlen |
N051FIELD1 |
8 |
C |
Value of FIELD1 after the modification |
rpos+8+tlen |
N051FIELD2 |
16 |
C |
Value of FIELD2 after the modification |
rpos+24+tlen |
N051FIELD3 |
16 |
C |
Value of FIELD3 after the modification |