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



So far as I know, there should be no need to use the BIF - RPG just does it right.

I'd go first with Rory's suggestion - get the value in debug first - and get the hex value, to see what the length is in the varying variable.

HTH
Vern

On 1/5/2012 11:28 PM, Richard Marion wrote:
Since the result field is a Char(17)... I would try the %CHAR() bif to
convert the VarChar to Char.

-----Original Message-----
From: rpg400-l-bounces+dpcmarion=decobug.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+dpcmarion=decobug.com@xxxxxxxxxxxx] On Behalf Of
Mike Wills
Sent: Thursday, January 05, 2012 9:26 PM
To: RPG programming on the IBM i / System i
Subject: VarChar to Char Field, Shouldn't This Work?

I have a RPG field defined as VarChar(17) and a file field defined as
Char(17). I thought I could do an eval on the two and it would work.

EDI850_Detail_Out.UnitPrice = EDI850_PO1_Record.UnitPrice

In the above, PO1 is the varchar field. I am getting the following error:
"Length of varying length variable is out of range."

Am I forgetting something? My head has been stuck in the .NET world a bit
too long me thinks....

--
Mike Wills
http://mikewills.me

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




-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4725 - Release Date: 01/05/12



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.