The *Record Data Changed PGM context field specifies whether the data for the current record has changed. The value *Yes means the record data has changed; the value *No means that the record data has not changed; it is initialized to ‘ ‘ (blank). The database record is updated only when the value of this field is *Yes.
Note: Checking for unchanged record data is done only if the Null Update Suppression function option is Y or A.
You can access the *Record Data Changed field from all functions that contain an embedded CHGOBJ function, such as EDTFIL and EDTTRN. It is valid only in the Data Read and Data Update user points in the action diagram of CHGOBJ functions; other uses give invalid results. Two ways to use this field are:
The following example illustrates a common technique for setting an audit stamp. The field, Timestamp, is set to the current date and time only if other fields within the record have been changed. In other words, if the value of the *Record Data Changed field is *Yes, then the audit stamp is written to the file.
The Timestamp field has the following characteristics:
> USER: Processing before Data update .— <<< :.> Only set the Timestamp field if other data has changed <<< :.—CASE <<< :|—PGM.*Record Data Changed is *Yes <<< :| DB1.Timestamp=JOB.*Job date <<< :| DB1.Timestamp=JOB.*Job time <<< :’—ENDCASE <<< ‘—
For more information on the CHGOBJ function, see this module, in the chapter "Defining Functions," CHGOBJ—Database Function topic.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |