×
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.
"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 10/07/2019
01:58:37 PM:
I have an RPGLE procedure that I need to call from a CLLE program.
The issue is the length (and type) of the parameters in the RPG
procedure - they are all VARCHAR and range in size from 50 to 1024.
For now, I have it "working" by defining the CL variables as the
"maximum size".
If your RPG procedure expects VARCHAR then you cannot pass a CL
*CHAR variable value and expect it to always work correctly. Instead, you
should pass a variable defined similar to the following. This is the CL
equivalent of a VARCHAR field. It is a CL data structure where the first
2 characters are a binary length value. This matches the memory layout of
an RPG VARCHAR(2) variable. If you need VARCHAR(4) then increase the
2-byte CL prefix to 4 bytes.
DCL VAR(&RTNMESG) TYPE(*CHAR) LEN(1026)
DCL VAR(&RTN_MDLEN) TYPE(*UINT) LEN(2) STG(*DEFINED) DEFVAR(&RTNMESG
1)
DCL VAR(&RTN_MDATA) TYPE(*CHAR) LEN(1024) STG(*DEFINED)
DEFVAR(&RTNMESG 3)
Sincerely,
Dave Clark
As an Amazon Associate we earn from qualifying purchases.
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.