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



On 02 May 2013 06:36, Steinmetz, Paul wrote:
We ran into an issue where a variable, defined as *CHAR with a
length of 5000, but either initialized or data moved to this field
exceeded 5000 characters, caused a subsequent command to fail because
of length limitation issue, CPD0183. How can this happen? Is this a
bug? How can a field have more data than it was defined for. We saw
the same results if the data was defined in an RPGLE program, passed
it the CL.

DCL VAR(&M) TYPE(*CHAR) LEN(5000)

SWPUSRPRF USRPRF(CPATEXT) CMD(SNDDST TYPE(*LMSG) +
TOINTNET((psteinmetz@xxxxxxxxxx)) +
DSTD(TEST) LONGMSG(&M))

Message ID . . . . . . : CPD0183 <<SNIP>>
Message . . . . : Embedded command SNDDST too long.
Cause . . . . . : The length specified for the embedded command
exceeds the defined length. Command length is 5001, but the maximum
length for the embedded command string is 5000.


Not sure what this has to do with RPG....

But the PARM(CMD) specification for the SWPUSRPRF command source should probably be modified to support a larger LEN() specification; i.e. currently the parameter is defined with LEN(5000). To be consistent with v5r3 SBMJOB, the CMD parameter could be designated as LEN(20000). That would easily enable the longest possible &M value and many list elements for TOINTNET() parameter on the SNDDST, plus any other parameters for SNDDST that might be necessary.

The following should help if the LONGMSG parameter allows an expression and the truncated message data is considered to be a valid means to resolve the issue:

SWPUSRPRF USRPRF(CPATEXT) +
/* ....+....1....+....2....+....3....+....4 */ +
CMD(SNDDST TYPE(*LMSG) +
TOINTNET((psteinmetz@xxxxxxxxxx)) +
DSTD(TEST) LONGMSG(%sst(&M 1 4928)) +
/* ....+....1....+ */ +
/* 19+34+34-15 = 72; 5000-72=4928 */


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.