|
Tommy, There is a potential problem with your code. If Cmd contains leading blanks, you will probably get a runtime error or undesirable results. Change this: Run(Cmd:%Len(%Trim(Cmd))); To: Run(Cmd:%Len(%TrimR(Cmd))); As a bonus, it's a little more efficient. -mark Original Message: ----------------- From: Holden Tommy Tommy.Holden@xxxxxxxxxxxxxxxxx Date: Wed, 15 Mar 2006 13:57:42 -0600 To: rpg400-l@xxxxxxxxxxxx Subject: RE: Help with call command QCMDEXC You have to pass the command string length to QCMDEXC. Here's how I use QCMDEXC... I have a copybook with the Prototype for the QCMDEXC procedure/program defined like so: DRun PR ExtPgm('QCMDEXC') D CmdStr 3000A Const Options(*VarSize) D CmdLen 15P 5 Const D CmdDBCS 3A Const Options(*NoPass) Then in my code I can just do this: /free cmd = 'RNM OBJ(''/pdf/2.pdf'') NEWOBJ(''test.pdf'')'; Run(Cmd:%Len(%Trim(Cmd))); /end-free It's even better when you use a varying size field for the command string D Cmd 3000A Varying Then you can just do this: /free cmd = 'RNM OBJ(''/pdf/2.pdf'') NEWOBJ(''test.pdf'')'; Run(Cmd:%Len(Cmd); /end-free Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx] On Behalf Of Alan Shore Sent: Wednesday, March 15, 2006 1:49 PM To: RPG programming on the AS400 / iSeries Subject: Re: Help with call command QCMDEXC Is there already an object out there called test.pdf? Alan Shore NBTY, Inc (631) 244-2000 ext. 5019 AShore@xxxxxxxx "Willie J. Moore" <WMoore@calfinewi re.com> To Sent by: <rpg400-l@xxxxxxxxxxxx> rpg400-l-bounces@ cc midrange.com Subject Help with call command QCMDEXC 03/15/2006 02:36 PM I have a program that I want to use the 'QCMDEXC' command. When I try to call it I get the following error: "Cannot resolve to object qcmdexc. Type and Subtype X'0201' Authority X'0000'." Here is a copy of the program: Dparms DS Dcmd 1 255 /free cmd = 'RNM OBJ(''/pdf/2.pdf'') NEWOBJ(''test.pdf'')'; /end-free C call 'qcmdexc' C PARM cmd C seton lr Any help or pointers would be appreciated. William Moore.... -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ .
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.