\\Physical File Record AS400//
d PGMNAME pr
d TrgBuffer_ like(TrgBuffer)
d TrgBufLen_ like(TrgBufLen)
d BefImg e ds extname(FILENAME) prefix(b_)
d AftImg e ds extname(FILENAME) prefix(a_)
d FILENAMER pi
d p$TrgBuffer like(TrgBuffer)
d p$TrgBufLen like(TrgBufLen)
TrgBuffer = p$TrgBuffer;
TrgBufLen = p$TrgBufLen;
NRO = NewRecOff + 1;
NRL = NewRecLen;
ORO = OrgRecOff + 1;
ORL = OrgRecLen;
// Set Before / After Images
BefImg = %subst(TrgBuffer:ORO:ORL);
AftImg = %subst(TrgBuffer:NRO:NRL);
select;
// Update
when TrgEvent = '3';
// Set last updated timestamp on record.
a_lstupd = %timestamp();
%subst(TrgBuffer:NRO:NRL) = AftImg;
p$TrgBuffer = TrgBuffer;
LAST_UPDATED for column LSTUPD
timestamp not null
generated always
for each row on update
as row change timestamp
No comments:
Post a Comment