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



Joel

Your first parameter has to be defined with length 502 - because the varying puts the length in the first 2 bytes.

If you are current enough, you can set up another 502-long parameter - I forget, but either *BASED or *DEFINED variables can't be declared over parameters.

Then do an *INT2 *DEFINED over the first 2 positions and a 500 *CHAR starting at position 3.

HTH
Vern

On 4/18/2013 4:47 PM, Stone, Joel wrote:
I am attempting to build a CL command (w/o ILE) with OPTIONAL parms.

Note: I now have 4 parms on both the command and the CPP, but still get CPD0162 error "Parameters do not match those in program SET_ENVR"


The IBM manual seems to show a simple MIN(0) MAX(1) on the PARM statement is all that is required.

PARM KWD(DBLIB) TYPE(*CHAR) LEN(10) RTNVAL(*YES) +
MIN(0) MAX(1) PROMPT('database lib: _CMISDB')

However if I use the command and skip some parms, I receive the error shown below.

set_envr &EMADDR1

Is there a trick to using OPTIONAL parms in a CMD and CL pgm? Or must they always match up?

Thanks


CMD PROMPT('Set Envr Names')
PARM KWD(TEXT) TYPE(*CHAR) RTNVAL(*YES) VARY(*YES +
*INT2) PROMPT('TEXT')
PARM KWD(DBLIB) TYPE(*CHAR) LEN(10) RTNVAL(*YES) +
PROMPT('database lib: _CMISDB')
PARM KWD(DATALIB) TYPE(*CHAR) LEN(10) +
RTNVAL(*YES) PROMPT('work lib: _DATALIB')
PARM KWD(FORCED2T) TYPE(*CHAR) LEN(1) +
RTNVAL(*YES) PROMPT('force DEMO to TEST? +
Y or blank')


SetEnvr CLP pgm:

PGM parm(&text &dblib &datalib &forceD2T)
dcl &text *char len(500)
dcl &dblib *char len(10)
dcl &datalib *char len(10)
dcl &forceD2T *char len(1)

dcl &workText *char len(500)
dcl &textLen *int len(4)
dcl &envr1 *char len(1) value('?')
dcl &envr4 *char len(4) value('????')
dcl &patternlen *dec len(3)
dcl &start_pos *dec len(3)
dcl &start_pos1 *dec len(3)
dcl &end_pos1 *dec len(3)
dcl &start_pos2 *dec len(3)
dcl &end_pos2 *dec len(3)

...


Message ID . . . . . . : CPD0162
Date sent . . . . . . : 04/18/13 Time sent . . . . . . : 16:41:33
Message . . . . : Parameters do not match those in program SET_ENVR in
*LIBL.
Cause . . . . . : The number of parameters in the command definition do not
match the number of parameters in the command processing or the validity
checker program SET_ENVR in library *LIBL.




______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs Skyscan service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


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.