× 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.



Hi Booth,

I've written a fair few RPG trigger programs recently.

We are on V7R3.

Here is how I have defined them...

// This Program ( Program Entry Parameters )
Dcl-Pi *N;
TrgBuf LikeDS( TrgBufDS );
TrgBufLen Int( 10 );
End-Pi;

Dcl-Ds TrgBufDS Qualified Template;
File Char( 10 );
Library Char( 10 );
Member Char( 10 );
TrgEvent Char( 1 );
TrgTime Char( 1 );
CmtLckLvl Char( 1 );
*N Char( 3 );
CCSID Int( 10 );
RRN Int( 10 );
*N Char( 4 );
OrgRecOfs Int( 10 );
OrgRecLen Int( 10 );
OrgRecNBOff Int( 10 );
OrgRecNBLen Int( 10 );
NewRecOfs Int( 10 );
NewRecLen Int( 10 );
NewRecNBOff Int( 10 );
NewRecNBLen Int( 10 );
End-Ds;

// Before Image
Dcl-Ds Before ExtName( 'STOCK' ) Qualified Based( pBefore );
End-Ds;

// After Image
Dcl-Ds After ExtName( 'STOCK' ) Qualified Based( pAfter );
End-Ds;

pBefore = %Addr( TrgBuf ) + TrgBuf.OrgRecOfs;
pAfter = %Addr( TrgBuf ) + TrgBuf.NewRecOfs;

In my case I haven't needed to access other info on the buffer but it is
all there in the TrgBuf parameter.
I hope this helps.

Best regards,
Craig

On 31 May 2018 at 18:40, Kevin Bucknum <Kevin@xxxxxxxxxxxxxxxxxxx> wrote:

I needs to be a 4 byte file - so 7b 0 or 10i 0 should be the only two that
work. But either of those should work.




Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Booth Martin
Sent: Thursday, May 31, 2018 12:32 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Trigger program buffer lots of stale/ bad info ??

This has frustrated me. A program I used successfully in 2011 is
failing. As I
looked at various examples I find on the web I found the same lines with
different values. This seems like it may be relevant.

....

* d OrOffset 7b 0
* d OrOffset 4b 0
* d OrOffset 10i 0

.....

I also searched with "Jan 2014 to current" and found almost nothing about
RPG triggers - just SQL Probably I need to go the SQL trigger route?


On 5/23/2018 5:51 PM, Charles Wilt wrote:
Booth,

I don't understand.

You're looking for documentation on the trigger buffer?

It wouldn't surprise me if it's changed between v5r4 and 7.1

But the 5.4 version should be compatible with the 7.1 version..

Charles

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


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.