×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Dave's correct...

Also the issue with variables bigger than 32 characters only comes into
play when you call a program (CL or RPG!) from the command line and/or
submit the program to batch and are attempting to pass a literal value into
the program.

In other words, if you program was
PGM PARM(&STMF)
DCL VAR(&STMF) TYPE(*CHAR) LEN(1024)

and you were trying to call it from a command line like
call mypgm parm('/tmp/myfile.txt')

you'd have a problem.

Charles

On Mon, Oct 7, 2019 at 12:27 PM Greg Wilburn <
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

I'm setting the variables to a fixed values in the CL... The actual data
values will never exceed 50 characters.

I just recall something goofy when you have CL Character variables over a
length of 32.

Here's the actual code:

PGM
DCLPRCOPT DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR(TBFBIND)

DCL VAR(&LOG) TYPE(*CHAR) LEN(50)
DCL VAR(&SUBJ) TYPE(*CHAR) LEN(100)
DCL VAR(&STMF) TYPE(*CHAR) LEN(1024)
DCL VAR(&TOADDR) TYPE(*CHAR) LEN(50)
DCL VAR(&CCADDR) TYPE(*CHAR) LEN(50)
DCL VAR(&MSG) TYPE(*CHAR) LEN(1024)
DCL VAR(&ERRID) TYPE(*INT) LEN(2)

CHGVAR VAR(&LOG)
VALUE('/ftplogs/NYR000-20191007-95915.log')

CHGVAR VAR(&SUBJ) VALUE('This is a test')
CHGVAR VAR(&STMF) VALUE(&LOG)
CHGVAR VAR(&TOADDR) VALUE('*IT_STAFF')
CHGVAR VAR(&CCADDR) VALUE(' ')
CHGVAR VAR(&MSG) VALUE('*ATT')
CALLPRC PRC('Eml_Stmf') PARM(('001TBF') +
(&SUBJ) (&STMF) (&TOADDR) (&CCADDR) (&MSG)) +
RTNVAL(&ERRID)
ENDPGM

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
Alan Campin
Sent: Monday, October 07, 2019 2:14 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: [EXTERNAL] Calling an ILE Procedure from CLLE

Not clear. Are these variables coming into the CL as VarChar's? If yes, I
don't see the problem.

Assuming a two byte header and 1024 length field you would just pass and
declare as a 1026 byte field. Receive as a VarChar(1024) in your RPG.


On Mon, Oct 7, 2019 at 2:03 PM Alan Shore via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi Greg
You may want to retest and put something MUCH larger into PARM1
I believe there is a limitation as to the size of what is passed into a
parameter (probably wrong - and Im getting mixed up with something else)

Try something that is over 100 characters just to be on the safe side

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
Greg Wilburn
Sent: Monday, October 7, 2019 1:59 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Calling an ILE Procedure from CLLE


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

For example:
The first parameter of the RPG procedure is VARCHAR(1024), so I defined
the CL variable &PARM1 as TYPE(*CHAR) LEN(1024).

CHGVAR VAR(&PARM1) VALUE('about this much data') CALLPRC
PRC('my_rpgProc') PARM((&PARM1) (&PARM2)...)

This seems to work (for now)... but I have this little voice in my head
telling me it could be a problem down the road.

I despise CL for this very reason.

Greg
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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 IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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 IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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 IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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 ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.