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



I guess my question is you know the length of the parameters why would you
ever pass them except at that length? If the command line is different. In
a program you know the length.

One solution as others have said is to make sure you always prototype your
calls.

dcl-pr GetCurrentValue ExtPgm('ABCPGM');
PR_Parm1 Char(50) Const;
PR_Parm2 Char(44) Const;
PR_Parm3 Char(512) Const;
end-pr

GetCurrentValue(Field125: Field210: Field3128);

Now it doesn't matter what length the field is the OS will pass the
declared length.

As to why it worked, like other have said. Just lucky. These kind of things
can hang around for years until junk ends up in a parameter and it blows
up.


On Thu, Jul 5, 2018 at 1:04 AM Erwin Donker <erwin.donker@xxxxxxxxxx> wrote:

Hi,

We have a CL program that uses 3 input parameters. The first parameter is
*CHAR length 50, the second parameter is *CHAR length 44 and the third
parameter is *CHAR length 512.

When this CL program is called with values that are smaller than the
parameter length (for instance 23 characters for the first parameter), we
have noticed that the value of the second parameter gets added tot he
first, starting at position 33.

I have searched the internet and have found that this behaviour is
intentional. From what I understand, *CHAR parameters are padded with
blanks up to 32 characters. Whatever was in memory after position 32
becomes part of the value of the first parameter.

I have also found several suggestions as workaround fort his issue, som y
question is nota bout how I can solve this problem. What I really don't
understand is why this CL program has worked for months without any
problems and then suddenly starts showing this behaviour. The program has
not been changed, the calling program has not been changed. We did apply
PTF's but this was 1 week before the CL program started showing this
behaviour so I don't think the PTF's are causing this. So basically what I
want to know is, why does using CL parameters over 32 characters sometimes
work, and sometimes not?

Another question out of curiosity, this "problem" has been around at least
since 1998 and probably much longer (1998 was the oldest information I
found online). I see many people having issues with this, so why has IBM
never changed this?

Erwin Donker


De disclaimer van toepassing op e-mail van de gemeente Den Haag vindt u
op: http://www.denhaag.nl/disclaimer
--
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: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.