Anyone out there know much about DB Tiggers?? I am a little familar with them and I have a task to save the New Record Image on an *Insert event. What I am having trouble with is the "Old Record Null Map" field. Specifically how to calulate the length of this field. I know I have to adjust the Old-Record and New-Record field's record lengths to coinside with the physical file length the trigger is on and the Null Map is the map of the null record fields of the DB file. The book says this charater sting has a length the same as the number of fields in the file. Well not true see Example. Or is it the number of nulls found in these five field??
The DB file is 37 positions long and has five fields. I had to use 18 on OLD-NULL-MAP because when I was debugging it I saw that's how many positions were between OLD-IMAGE and NEW-Image.
How do I calculate the length of this so my positioning is not off for New-Record-Image??
PHP Code:
LINKAGE SECTION.
01 LK-PARM1.
03 FILE-NAME PIC X(10).
03 LIB-NAME PIC X(10).
03 MEM-NAME PIC X(10).
03 TRG-EVENT PIC X(01).
03 TRG-TIME PIC X(01).
03 CMT-LCK-LVL PIC X(01).
03 FILLER PIC X(03).
03 DATA-AREA PIC 9(08) BINARY.
03 RR-NUMBER PIC 9(08) BINARY.
03 FILLER PIC X(04).
03 DATA-OFFSET.
05 OLD-REC-OFF PIC 9(08) BINARY.
05 OLD-REC-LEN PIC 9(08) BINARY.
05 OLD-REC-NMAP PIC 9(08) BINARY.
05 OLD-REC-NLEN PIC 9(08) BINARY.
05 NEW-REC-OFF PIC 9(08) BINARY.
05 NEW-REC-LEN PIC 9(08) BINARY.
05 NEW-REC-NMAP PIC 9(08) BINARY.
05 NEW-REC-NLEN PIC 9(08) BINARY.
05 FILLER PIC X(16).
03 RECORD-INFO.
* Old and New Image(s) are the R/L of the file/data being saved
05 OLD-IMAGE PIC X(37).
05 OLD-NULL-MAP PIC X(18).
05 NEW-IMAGE PIC X(37).
05 NEW-NILL-MAP PIC X(09).
How do I calculate the length of this so my positioning is not off for New-Record-Image??
Comment