You could do it this way:
CMD PROMPT('START, STOP, STATUS TO ICAPI')
PARM KWD(IP) TYPE(*CHAR) LEN(15) MIN(1) +
PROMPT('ICAPI SERVER IP')
PARM KWD(CMD) TYPE(*CHAR) LEN(34) RSTD(*NO) +
DFT(*DEFAULT) SPCVAL((*DEFAULT)) +
PROMPT('ICAPI CMD')
Then in the command processing program, if '*DEFAULT' is passed in,
replace it with your 34-character string.
Trevor Briggs
Analyst/Programmer
Lincare, Inc.
(727) 431-1246
TBriggs2@xxxxxxxxxxx
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Steinmetz, Paul
Sent: Thursday, April 10, 2014 3:55 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: CLP pgm with 2 paramters intermittently
gettinggarbagewhencalled from AJS
CMD PROMPT('Start, Stop, Status to ICAPI')
PARM KWD(IP) TYPE(*CHAR) LEN(15) MIN(1) +
PROMPT('ICAPI Server IP')
PARM KWD(CMD) TYPE(*CHAR) LEN(34) RSTD(*NO) +
DFT('sudo /sbin/service jboss-as stat') + (32 chars
max)
PROMPT('ICAPI CMD')
Paul
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Thursday, April 10, 2014 3:32 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: CLP pgm with 2 paramters intermittently gettinggarbage
whencalled from AJS
On 4/10/2014 3:17 PM, Steinmetz, Paul wrote:
Thanks everyone for all the help and tips.
Parm length corrected along with CMD created.
For a CMD default value, the maximum positions is 32.
I need 34.
Is this 32 cmd parm length issue the same we've been discussing, or is
this a different maximum.
From CMD help text.
o If the default is a character constant, it can have no more than
32 bytes.
Paul
Post your command source so we can work out exactly which '32' you are
looking at. For comparison purposes, here's the start of a RUNSQL
command I wrote many years ago:
CMD PROMPT('Run a SQL statement')
PARM KWD(SQLSTM) TYPE(*CHAR) LEN(1280) MIN(1) +
EXPR(*YES) PROMPT('SQL statement')
PARM KWD(OUTPUT) TYPE(*CHAR) LEN(8) RSTD(*YES) +
DFT(*) VALUES(* *PRINT *OUTFILE) +
EXPR(*YES) PROMPT('Output')
-snip-
The thing I don't understand is why is it intermittent.
Today it ran fine 3 times, no garbage.
Yesterday, all kinds of garbage.
Parms are basically pointers to memory locations.
CL don't stay in memory, every time you call, reloads a fresh copy.
Where is the garbage coming from?
You nailed it in one. Parms are pointers to memory locations. Your
buffer contains room for 34 bytes. The command processor clears 32
bytes of that buffer. The last 2 bytes will contain whatever the
previous step in your job left there. Depending on what you did
earlier, there may or may not be blanks in those 2 bytes.
--buck
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.