MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » April 2014

Re: CLP pgm with 2 paramters intermittently gettinggarbagewhencalled from AJS



fixed

Hi, Vern:

I tested this on my old IMPI machine running V3R2, and this limitation was still present.

So, it seems a PMR would likely not be accepted as a valid APAR ... .

Instead, what is needed is a DCR (enhancement request).

Mark

> On 4/10/2014 6:03 PM, Vernon Hamberg wrote:
Hey Mark

That is strange, that CHGCMDDFT will accept it - now maybe it's because
you're not using a "character constant" in one of those PARM parameters.

This makes me wonder if a prompt override could effect the same result.
No time to check right now.

Vern

On 4/10/2014 4:24 PM, Mark S Waterbury wrote:
Hi, Vern:

I see that now, too ... thanks for mentioning this.

Apparently, I had changed the length to LEN(41), but the actual literal
value I typed in was exactly 32 characters ... but I did not notice
that ... But, the CHGCMDDFT circumvention seems to work fine.

V5R3 was the first release when IBM started "enhancing" CL, after many
years of neglect. Somehow, they must have messed this up in the
process. :-\

I still think someone should still open a PMR for this ... or submit a
requirement to COMMON ...

All the best,

Mark S. Waterbury

> On 4/10/2014 5:17 PM, Vernon Hamberg wrote:
Hi Mark

I see the same restriction on the DFT parameter of PARM in V5R3.

I believe this goes way back - here is something from v3R2 -

However, the maximum length allowed for character constants in the command definition statements is 32 characters. This restriction applies to the CONSTANT, DFT, VALUES, REL, RANGE, SPCVAL, and SNGVAL parameters.


So I'm not sure what's up - maybe it was broken all along and now
finally fixed.

Cheers
Vern

On 4/10/2014 3:38 PM, Mark S Waterbury wrote:
Paul:

Wow -- it worked fine for me, at V5R4 ... So, I just tested it again at
V7R1, and now I get the error message about the "32 character" limitation.

IBM has apparently broken this, in a manner that is not
upwards-compatible from previous releases of OS/400 and i5/OS ... not
sure when it was "broken" -- in V6R1, or V7R1, or one of the TRs on top
of V7R1 ...

You should immediately "Open a PMR" to get IBM to fix this.

All the best,

Mark S. Waterbury

> On 4/10/2014 4:21 PM, Steinmetz, Paul wrote:
So you can't code a CMD with a default of more than 32 characters, must do that in the CL, correct.
One last question.
This command or CLP can only run as user ICAPICTL.
Is there way of SWPUSRPRF within the CMD.
I know I can code the CL do to this if necessary.

Paul

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Briggs, Trevor (TBriggs2)
Sent: Thursday, April 10, 2014 4:07 PM
To: Midrange Systems Technical Discussion
Subject: RE: CLP pgm with 2 paramters intermittently gettinggarbagewhencalled from AJS

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.

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

************************************************************************************************************************************************************************************************************
This message originates from Lincare Holdings Inc. It contains information which may be confidential or privileged and is intended only for the individual or entity named above.
It is prohibited for anyone else to disclose, copy, distribute or use the contents of this message.
All personal messages express views solely of the sender, which are not to be attributed to Lincare Holdings Inc., and may not be copied or distributed without this disclaimer.
If you received this message in error, please notify us immediately at MailAdmin@xxxxxxxxxxx or (800) 284-2006.
************************************************************************************************************************************************************************************************************

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







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact