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



Ok...my bad...

v The CL variable value must be one of the following: – A character
string as long as 5000 characters. – A packed decimal value totaling
up to 15 digits with as many as 9 decimal positions.

Either ditch CL or define it as char and set the hex value to the
packed value...

Charles

On Thu, Jun 30, 2011 at 3:35 PM, Kurt Anderson
<kurt.anderson@xxxxxxxxxxxxxx> wrote:
Hi Charles,

I created a test program that only contains the following, and it errored as well.
            DCL        VAR(&BTN)        TYPE(*DEC)  LEN(16 0)
            CHGVAR     VAR(&BTN) VALUE(9996904670)

  1300-              DCL        VAR(&BTN)        TYPE(*DEC)  LEN(16 0)
* CPD0732 40  Length specified is too long for variable type.

RDp doesn't complain when I entered the value in, but I'm definitely having a compiling issue.

I'm at 7.1.  We recently upgraded to a Power system - could there be some kind of system value restricting me?

When I change it from (16 0) to (15 0), it compiles.

Thanks,
Kurt

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Thursday, June 30, 2011 2:07 PM
To: Midrange Systems Technical Discussion
Subject: Re: CL calling RPG with Varying Parm

the 15,5 "limit" only applies to a literal value on the CALL command from the command line.

this works fine

dcl  &mynbr   dec(16,0)
call rpgpgm parm(&myNbr)

if you're call the CL and pass the value in like so:
pgm parm(&myNbr)
dcl  &mynbr   dec(16,0)
call rpgpgm parm(&myNbr)


then create a command front end....

HTH,
Charles

On Thu, Jun 30, 2011 at 2:52 PM, Kurt Anderson <kurt.anderson@xxxxxxxxxxxxxx> wrote:
Do you have any tips for me trying to pass a 16 (16,0) digit numeric value from CL to RPG?  Ie. Any way to get around the 15,5 limitation?

Thanks,
Kurt

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Morgan, Paul
Sent: Thursday, June 30, 2011 11:21 AM
To: Midrange Systems Technical Discussion
Subject: RE: CL calling RPG with Varying Parm

Kurt,

The varying length is a two byte integer value at the start of &PARM1.

To match the variable in the RPG program

DCL VAR(&PARM1) TYPE(*CHAR) LEN(52)

CHGVAR VAR(%SST(&PARM1 1 2))  VALUE(X'0032') CHGVAR VAR(%SST(&PARM1 3
50)) VALUE('508656904670')

CALL PGM(RPGPRogram) PARM(&PARM1)

Paul Morgan

Principal Programmer Analyst
IT Supply Chain/Replenishment


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Kurt Anderson
Sent: Thursday, June 30, 2011 11:56 AM
To: 'Midrange Systems Technical Discussion' (midrange-l@xxxxxxxxxxxx)
Subject: CL calling RPG with Varying Parm

I'm trying to unit test a program that has a varying parameter and I can't seem to get the call to work successfully.  I keep getting a "Length of varying length variable is out of range" error as the RPG program moves the entry parameter into another field.

RPG Prototype:
D RPGProgram      PR
D  parm1                        50a   Const Varying

Technically, parm1 is defined like a file's field that has VARLEN specified.  I believe RPG treats that as Varying when you do a LIKE.

CL call:
            DCL        VAR(&PARM1)        TYPE(*CHAR) LEN(53)

/* first two bytes of value is the length */
            CHGVAR     VAR(&PARM1) VALUE('508656904670')

            /*  to prevent truncating trailing of blanks */
            CHGVAR     VAR(%SST(&PARM1 53 1)) VALUE('X')

            CALL       PGM(RPGProgram) PARM(&PARM1)

I've tried this a variety of ways.  With LEN(50), w/o the trailing X, w/o specifying the length in &PARM1.

I'm on 7.1.

Thanks for the help,

Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems
--
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.


--
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

--
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.

--
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: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



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