|
There is also a third option. The QCAPCMD API is a more robust version of QCMDEXC. I prefer it over QCMDEXC because it returns error information as well as having command prompting and validation options. I have actually wrapped it into a module that I call from my other RPG programs. You can find more information about it at this link http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm. Rick -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bruce Odum Sent: Thursday, November 11, 2004 6:22 AM To: RPG programming on the AS400 / iSeries Subject: RE: QCMDEXC You have two options here they are In this example you have to build the cmdstr and use callp If you want to send and receive values you need to do it this way * Run Procedure D Run PR ExtPgm('QCMDEXC') D Cmdstr 3000A Options(*VarSize) D Cmdlen 15P 5 Const D CmdDbcs 3A Const Options(*NOPASS) *--------------------------------------------------------------- C Callp Run ( cmdstr : %Size(Cmdstr) ) If you don't need to receive a value back you can use this H Bnddir( 'USXEMAIL' : 'QC2LE' ) * Prototype for 'system' d System PR 10I 0 ExtProc('system') d CmdText * Value Options(*String) d EF S 10I 0 Inz(0) /free command = 'CPYTOIMPF FROMFILE(' + %TRIM(P_FILE) + ' ' + %TRIM(P_MEMBER) + ') TOSTMF(''' + %TRIM(T_DOC) + ''')' + ' STMFCODPAG(*PCASCII) RCDDLM(*CR) DTAFMT(*FIXED)'; EF = system(command); /endfree
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.