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



Joe,

I apologize - I looked at the code quickly and thought that I saw "varying" on the prototype variable. The code will work. But would putting *VARSIZE on the Cmd line perform better or would that just add operational descriptor overhead?

-mark

At 6/22/03 10:22 PM, you wrote:
> From: M. Lazarus
>
>   I think that this code will give you an error.  You need OPTIONS(
> *VARSIZE ) on the Cmd definition.  Otherwise you will get the leading 2
> characters (binary length of varying variable) being passed to QCMDEXC.

No you won't, which is sort of the point of the post.  CONST allows the
compiler to make conversions, including between VARYING and non-VARYING
fields.

Rather than guess, give it a try first.  And while I know most people aren't
sick and twisted like me and have access to a machine on the weekend, at the
same time you might want to take the time to test before throwing FUD on the
fire.

Here's the working code, which I did take the time to test:


DQcmdexc PR EXTPGM('QCMDEXC') D Cmd 128 const D CmdLen 15 5 const

D command s 128 varying

C                   eval      command = 'SNDMSG ''HELLO'' QSYSOPR'
C                   callp     Qcmdexc(command:%len(command))

C eval *inlr = *on


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.