× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Gentlemen, thank you for your assistance. I finally figured out that I
needed to define the buffer data structure, then use the LIKEDS in the
*entry parameter. I guess I haven't had to define a data structure for an
*entry parameter before.

For anyone else's future reference, I've posted the source code below.
Note that the TRG001H file defines an event flag, timestamp, and then the
record layout of the triggered table.

fTRG001H o e disk
d EntryParms pr ExtPgm( 'TRG001R' )
d eTrgBuffer LikeDS( TrgBuffer )
d eTrgBufferLen Like( TrgBufferLen )
d EntryParms pi
d eTrgBuffer LikeDS( TrgBuffer )
d eTrgBufferLen Like( TrgBufferLen )
/copy TRGBUFCOPY
d TriggerPtr s *
d TriggerRecord e ds ExtName( OWNER )
d Based( TriggerPtr )
d Prefix( T_ )
d OutputRecord e ds ExtName( OWNER )
/free
Select;
When eTrgBuffer.tbEvent = '1'; // Insert (keep after image)
TriggerPtr = %addr( eTrgBuffer ) + eTrgBuffer.tbNewOffset ;
TrgType = 'I';
When eTrgBuffer.tbEvent = '2'; // Delete (keep before image)
TriggerPtr = %addr( eTrgBuffer ) + eTrgBuffer.tbOldOffset ;
TrgType = 'D';
When eTrgBuffer.tbEvent = '3'; // Update (keep after image)
TriggerPtr = %addr( eTrgBuffer ) + eTrgBuffer.tbNewOffset ;
TrgType = 'C';
Endsl;

TrgTmStamp = %timestamp;
OutputRecord = TriggerRecord;
Write TRG001Hr;

*inLR = *on;
Return;
/end-free

Source TRGBUFCOPY:
d TrgBuffer ds
d tbFileName 10
d tbLibraryName 10
d tbMemberName 10
d tbEvent 1
d tbTime 1
d tbCommitLock 1
d tbFill01 3
d tbCCSID 10i 0
d tbRRN 10i 0
d tbFill02 10i 0
d tbOldOffset 10i 0
d tbOldLength 10i 0
d tbOldNullOff 10i 0
d tbOldNullLen 10i 0
d tbNewOffset 10i 0
d tbNewLength 10i 0
d tbNewNullOff 10i 0
d tbNewNullLen 10i 0
d tbBufChar 1 32767
d tbBufArry 1 Overlay( tbBufChar )
d Dim( %size( tbBufChar ))

d TrgBufferLen s 10i 0

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.