I think we have to stop making assumptions about people and ask them questions instead. We've all made mistakes with QCMDEXC in RPG, and we all need help on how to ask questions better.

JMHO - from one who has not been patient all the time!

Srinivas - the length parameter has to be the exact length of the command - you are better off using something like

%len(%trim(cmd)) in a prototyped call of QCMDEXC - I think someone gave you what the prototype and the call look like.


-------------- Original message --------------
From: "Mark Allen" <scprideandms@xxxxxxxxx>

IIRC, the class assignment was to do a RUNQRY from RPG

On Tue, Mar 4, 2008 at 2:50 PM, Srinivas Boggula

Now I can able to go wrkqry screen
But I don't want to go to wrkqry screen instead it should run the
File and save it as a name how to do it?

Any input greatly appreciated


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Pat Landrum
Sent: Wednesday, March 05, 2008 1:16 AM
To: Midrange Systems Technical Discussion
Subject: RE: Error while calling QCMDEXC API


Change the initial value of d$len1 to 6.


DxpQcmdExc Pr ExtPgm('QCMDEXC')
D Command 2000 Const Options(*VarSize)
D CommandLen 15 5 Const
D Cmds S 2000


Cmds = 'WrkQry';


Pat Landrum
Senior Programmer/Analyst
Hanover County School Board
200 Berkley Street - Ashland, VA. 23005
Phone: 804-365-4658 Email: plandrum@xxxxxxx

Notice: This message or any accompanying documents may contain
confidential or privileged information of Hanover County Public Schools.
If you are not the intended recipient, disclosure, copying or
distribution is strictly prohibited by state and federal law. If you
received this message in error, please notify the sender as soon as

-----Original Message-----
From: Srinivas Boggula [mailto:Srinivas.Boggula@xxxxxxxxx]
Sent: Tuesday, March 04, 2008 2:10 PM
To: Midrange Systems Technical Discussion
Subject: Error while calling QCMDEXC API

Hi All,

I am trying to CALL QCMDEXC API from RPGIV program the reason why I am
Running is to run WRKQRY command from RPGIV and I want to store the
results With Query Name. But when trying to execute below command I'm
getting error Message.


d$cmd1 s 256 inz
d$len1 s 15 5 inz(256)

eval $cmd1 = 'WRKQRY'
call 'QCMDEXC'
parm $cmd1
parm $len1

Thanks in advance.


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 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].