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

At 6/20/03 05:55 PM, you wrote:
The nice thing about CONST as opposed to VALUE is that CONST can be used
with EXTPGM calls.  One good example is for QCMDEXC; if you specify the
length as CONST, you can pass in an expression such as %LEN(CmdString).  In
the following example, assume command, lib and file are all VARYING strings:

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

C                   eval      command = 'CRTPF ' + lib + '/' + file
C                   callp     Qcmdexc(command:%len(command))

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.


-mark


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.