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)
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Thursday, April 10, 2014 3:32 PM
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
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) +
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.
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,
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l