|
Thank Again I got it and aready have it running with both ways below to use as example to Client. * Set up Procedure for QCMDEXC D Qcmdexc pr Extpgm('QCMDEXC') D Cmd Like(Qcmd) Options(*Varsize) D Len 15p 5 Const D Opt 3 Options(*NoPass) Const * D Qcmd s 3000 C Eval Qcmd = 'CLRPFM FILE('+ C %trim(DRKY) + ')' * C CallP(E) Qcmdexc(Qcmd:%Len(%Trim(Qcmd))) * C If %Error C Eval Qcmd = 'SNDMSG MSG(''Member not found ' + C %trim(DRKY) + ''')' + C ' TOUSR(' + User + ')' C CallP Qcmdexc(Qcmd:%Len(%Trim(Qcmd))) C Endif * Notice the ErrorCPF - Import can check for CPF???? * Execute Command (system) Subprocedure Variables D System PR 10I 0 ExtProc('system') D * Value Options(*String) * D CPFerr S 7A Import('_EXCP_MSGID') * C CallP(E) System('CLRPFM FILE('+ C %trim(DRKY) + ')') C If CPFerr = 'CPF3141' C CallP System('SNDMSG MSG(''Member not found '+ C %trim(DRKY) + ''')' + C ' TOUSR(' + User + ')') C Endif * Thanks Bill Hopkins Comments,questions, or "Knocks in the Head" welcomed. MWalter@xxxxxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 09/04/2003 04:27 PM Please respond to RPG programming on the AS400 / iSeries To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc: Subject: Re: Trying to Find API for ADDPFM It's really not the name szCmd. It's the fact the defining a Prototype (PR in col 24) doesn't define the variables used as parameter names. That is done in the PI. Because you are prototyping a C procedure, there is no PI so if you wanted to define a szCmd as Varying and pass that, And, you don't have to use /FREE. Here is an example: Dsystem PR 10i 0 extproc('system') D * options(*string) value DszCmd S 500 varying C eval szCmd = 'ADDPFM FILE(MyFile) MBR(MyMbr)' C if system(szCmd) <> 0 C do something here Thanks, Mark Mark D. Walter Senior Programmer/Analyst CCX, Inc. mwalter@xxxxxxxxxx http://www.ccxinc.com "Bill Hopkins" <BHopkins@LibertyHar To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> dware.com> cc: Sent by: Subject: Re: Trying to Find API for ADDPFM rpg400-l-bounces@mid range.com 09/04/2003 04:00 PM Please respond to RPG programming on the AS400 / iSeries Thanks much, But I know the Client would S@#T over seeing /FREE was just trying to sneak in system prototype so I could handle messages better. Any one know why it does not like the name szCmd? Thanks Bill Hopkins MWalter@xxxxxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 09/04/2003 03:48 PM Please respond to RPG programming on the AS400 / iSeries To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc: Subject: Re: Trying to Find API for ADDPFM because the prototype doesn't 'define' the variable You really don't even have to name it if you don't want to. You could define it like this: Thanks, Mark Mark D. Walter Senior Programmer/Analyst CCX, Inc. mwalter@xxxxxxxxxx http://www.ccxinc.com "Bill Hopkins" <BHopkins@LibertyHar To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> dware.com> cc: Sent by: Subject: Re: Trying to Find API for ADDPFM rpg400-l-bounces@mid range.com 09/04/2003 03:39 PM Please respond to RPG programming on the AS400 / iSeries Hey got question about example in acticle: D system PR 10I 0 ExtProc( 'system' ) D szCmd * Value Options( *String ) How come szCmd gets "*RNF7030 The name or indicator szCmd is not defined." Is it because I'm on v5r1. By the way I decided to do it anyway :) Hell, all but one, won't notice anyway. Thanks Bill Hopkins Marco Facchinetti <facchinetti@xxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 09/04/2003 01:13 PM Please respond to RPG programming on the AS400 / iSeries To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc: Subject: Re: Trying to Find API for ADDPFM Just about that: http://www.mcpressonline.com/mc/.6ae795bb HTH Marco --- MWalter@xxxxxxxxxxxxxxx wrote: > > You could use the C 'system' function and import the > '_EXCP_MSGID' to > monitor for the not found message. > > Thanks, > > Mark > > Mark D. Walter > Senior Programmer/Analyst > CCX, Inc. > mwalter@xxxxxxxxxx > http://www.ccxinc.com > > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com _______________________________________________ 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. _______________________________________________ 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. _______________________________________________ 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. _______________________________________________ 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. _______________________________________________ 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 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.