Here is the template I use for trigger programs.

     Hdatedit(*YMD)

     DStatus          SDS
     D user                  254    263

     DinputDs          DS
     D file                          10
File Name
     D lib                           10
Library Name
     D mbr                           10
Member Name
     D event                          1
Event
     D etime                          1
before or after
     D commit                         1
Commitment scope
     D fill01                         3
reserved
     D ccsid                         10i 0
Character map ID
     D rrn                           10i 0
Relative Record
     D fill02                        10i 0
reserved
     D oro                           10i 0
Old Rec offset
     D orl                           10i 0
Old Rec Length
     D orno                          10i 0
Old Null Map Offset
     D ornl                          10i 0
Old Null Map Length
     D nro                           10i 0
New Rec Offset
     D nrl                           10i 0
New Rec Length
     D nrno                          10i 0
New Null Map Offset
     D nrnl                          10i 0
New Null Map Length

      * Insert file name in Extname keyword
     D oldRec        E DS                  extname(FILENAME) prefix(o_)
Old Record image
     D                                      based(p_oldRec)
     D newREc        E DS                  extname(FILENAME) prefix(n_)
New Record image
     D                                      based(p_newRec)

     D inputdslen      S             10i 0

     C     *entry        PLIST
     C                   PARM                    inputDs
     C                   PARM                    inputDsLen
      * Load the external data structures' pointer value with the
      * address of the input Data structure + the offset of the
      * record.
     c                   eval      p_oldRec = %addr(inputDs) + oro
     c                   eval      p_newRec = %addr(inputDs) + nro
      * process based on event
?    C                   SELECT
?     * Add
?    C                   WHEN      event = '1'
?     * Delete
?    C                   WHEN      event = '2'
?     * Change
?    C                   WHEN      event = '3'

?    C                   ENDSL

     c                   return


Thanks,

Mark


Mark Walter
Sr. Programmer/Analyst
Hanover Wire Cloth a div of CCX, Inc.
mwalter@xxxxxxxxxxxxxxx
http://www.hanoverwire.com
717.637.3795 Ext.3040
/"\
\ /
 X
/ \



                                                                                
                                                                      
                    "Dan Neal"                                                  
                                                                      
                    <dneal@xxxxxxxxxx>           To:     "Midrange Systems 
Technical Discussion" <midrange-l@xxxxxxxxxxxx>                            
                    Sent by:                     cc:                            
                                                                      
                    midrange-l-bounces@xx        Subject:     Trigger Program   
                                                                      
                    drange.com                                                  
                                                                      
                                                                                
                                                                      
                                                                                
                                                                      
                    02/28/2003 09:26 AM                                         
                                                                      
                    Please respond to                                           
                                                                      
                    Midrange Systems                                            
                                                                      
                    Technical Discussion                                        
                                                                      
                                                                                
                                                                      
                                                                                
                                                                      




It has been awhile since I have done a trigger program. I searched the
archives for sample RPG code without luck. Does anyone have a link or
sample
code?

Thanks

Dan

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.







As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.