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






Willie,

When a trigger program is called, it passes several parameters to the
program.  Neither of your programs have any parameters defined.  Or, were
these programs one of the numerous programs that normally update your file
and you're wondering why they don't call the trigger?  I suspect it is the
former and not the latter.  (Would have helped to put the program names in
them.)

You need to RTFM.  This is a good link to start with:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/dbp/rbafomst02.htm#ToC_456
It even has a sample RPG trigger program.  Go through that and if you still
have questions, let us know.

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin



                                                                           
             "Willie J. Moore"                                             
             <WJMoore@calfinew                                             
             ire.com>                                                   To 
             Sent by:                  <rpg400-l@xxxxxxxxxxxx>             
             rpg400-l-bounces@                                          cc 
             midrange.com                                                  
                                                                   Subject 
                                       Trigger Help                        
             10/27/2003 03:28                                              
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
              RPG programming                                              
              on the AS400 /                                               
                  iSeries                                                  
             <rpg400-l@midrang                                             
                  e.com>                                                   
                                                                           
                                                                           




I am trying to do my first 'Trigger' program and not having much luck.  I
have a file that records are written to from several programs. I currently
have a CL that runs every 2mins. It reads my file and executes a program
that adds the record to a query file after some exiting.
What I want to do is have the CL and program run when every there is a
recorded added.  I am using RPG III.
Here are the file layout and part of the CL and RPG program.

File: 1 field called ZZUSER for 128.

CL:                ovrdbf            file(trdata) tofile(wjmwork/zzuser)
             ovrdbf                        file(dcsnew)
tofile(wjmwork/dcsnew)
             call                    pgm(wjmwork/trdata)

RPG:         F:trdata                      uf          f           128
 disk
             F:dcsnew          o           f           192         disk
             a

             I:trdata          ns          01
             I:                                              1           1
       recid
             I:                                              8           12
       badge
             I:                                              25          30
       date
             I:                                              31          36
       time
             C:                      again             tag
             C:                                  read        trdata
                         lr
             C:                      *inlr             ifeq        '1'
             C:                                  goto        endpgm
             C:                                  end
             C:*
             C:                      recid             ifne        'A'
             C:                                  goto        again
             C:                                  else
             C:                                  excpt             update
             C:                                  excpt             delrec
             C:                                  end
             O:dcsnew          eadd        update
             O:                                  badge
 22
             O:                                  date                    17
             O:                                  time                    30
             O:trdata          e           delrec

I do the following command to add the trigger: addpftrg
file(wjmwork/zzuser) trgtime(*after) trgevent(*insert)
pgm(wjmwork/dcscoletcl) rpltrg(*yes)

I would appreciate it if some one can give me help on getting this working.
It seams like it should be so simple.

Thanks in advance,
William Moore
wjmoore@xxxxxxxxxxxxxxx <mailto:wjmoore@xxxxxxxxxxxxxxx>
805-489-5144 ex.234



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

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.