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



Is anyone using a CLP as the trigger program?  I am creating an audit file from 
an *Update trigger, however, was wondering how to keep the library list 
straight so the program that called the trigger program completes normally.   
The Sorcerer book says a CLP can be used, however, it appears that RPG is the 
suggested route. 

Tracy L. Ball
The Jackson Group
Sr. Programmer/Analyst 
(317) 781-4600 ext. 3107



-----Original Message-----
From: Buck Calabro [mailto:Buck.Calabro@xxxxxxxxxxxx]
Sent: Friday, March 21, 2003 12:16 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Programming a trigger audit in ILE


>Buck, null values in SQL are short integers, but in the trigger buffer
>they are single-byte characters (RPG indicators).
>
>> DRtnNullRaw       ds                  occurs(10)
>> D NullMap                         n   dim(9)

Barbara's absolutely right.  I pulled the example from the wrong program.
My trigger maps look like this:

D TrgBuf        E DS                  EXTNAME(Trigger)          
                                                                
 * We can't tell how many fields are in the file;               
 * to avoid hard-coding the number, set up an arbitrarily large 
 * array to hold the null map.  Remember that you can only      
 * trust the array up to the null map length!!!                 
D OldNulImg       ds         32766    Based(POldNul)            
D  OldNulMap                     1a   dim(%size(OldNulImg))     
D NewNulImg       ds         32766    Based(PNewNul)            
D  NewNulMap                     1a   dim(%size(NewNulImg))     

 * Map the file I/O buffers from the external definitions
D OldRcdImg     E DS                  EXTNAME(DATESAMPLE)
D                                     based(pOldRcd)     
D                                     prefix(O_)         
D NewRcdImg     E DS                  EXTNAME(DATESAMPLE)
D                                     based(pNewRcd)     
D                                     prefix(N_)         

C     *Entry        Plist                            
C                   Parm                    TrgBuf   
C                   Parm                    TrgBufLen
C                   Parm                    TrgRtnCde

C                   EVAL      pOldRcd = %ADDR(TrgBuf)+ Z1OROFF
C                   EVAL      pOldNul = %ADDR(TrgBuf)+ Z1ORNBO
C                   EVAL      pNewRcd = %ADDR(TrgBuf)+ Z1NROFF
C                   EVAL      pNewNul = %ADDR(TrgBuf)+ Z1NRNBO

Sorry for the snafu, and thanks, Barbara!
  --buck
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.