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



Yes Greg,

What Dave has done is akin to how you might define a data structure in
RPGLE and the length field &VarLen is defined as an unsigned integer.
When you update it's value, it causes the positions it occupies in the
parent structure &VarStr to be set correctly for a 2 byte integer.

%Bin is for when you want to pull numerics out of a character field.

regards,
Craig

On Tue, 27 Nov 2018 at 17:16, Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:

Thanks!

This works very well.

Just to be clear, I set &VARLEN equal to 3 (the size of my data). I did
not use the %BIN option.

Greg

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
dlclark@xxxxxxxxxxxxxxxx
Sent: Tuesday, November 27, 2018 11:47 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <
rpg400-l@xxxxxxxxxxxx>
Subject: Re: CALLPRC

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 11/27/2018 11:35:14
AM:
I am trying to call a well-established RPG procedure (function) from a
CLLE program. I call this all the time from RPGLE.

When executing the CLLE pgm, I get "Length of varying length variable
is out of range"

The ILE RPG procedure is defined as follows:
P Ast_GetRf B Export
Procedure to Get
D Ast_GetRf pi 800a
Reference File Data
D incat 4a Const
Input Category
D inslc 16a Varying Const
Input Selection

I've tried all different iterations within the CL pgm. I don't do
this very often... so I know I'm missing something.
The CLLE looks like this:

DCL VAR(&RFCAT) TYPE(*CHAR) LEN(4)
DCL VAR(&RFSLC) TYPE(*CHAR) LEN(16)
DCL VAR(&RFDTA) TYPE(*CHAR) LEN(800)

CHGVAR VAR(&RFCAT) VALUE('0021')
CHGVAR VAR(&RFSLC) VALUE(&WHS#)
CALLPRC PRC('Ast_GetRf') PARM((&RFCAT) (&RFSLC))
RTNVAL(&RFDTA)

I'm just about to give up and write a RPGLE program to call from the
CLP. Any insight would be appreciated.


I do this, too, and it works for me. What you have to do in CL/LE
is to build in the 2-byte binary length of the varying length string you
are passing to RPG/LE. For example:

DCL VAR(&VARSTR) TYPE(*CHAR) LEN(82)
DCL VAR(&VARLEN) TYPE(*UINT) LEN(2) STG(*DEFINED) DEFVAR(&VARSTR 1)
DCL VAR(&VARDATA) TYPE(*CHAR) LEN(80) STG(*DEFINED) DEFVAR(&VARSTR 3)


Sincerely,

Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331




Greg

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://amazon.midrange.com



*********************************************************************************************
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please immediately
notify the sender and delete and destroy the message and all copies. All
unauthorized direct or indirect use or disclosure of this message is
strictly prohibited. No right to confidentiality or privilege is waived or
lost by any error in transmission.

*********************************************************************************************
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.