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




Francois, for an assignment between two varying-length fields, it's not
necessary for them to have the same size of varying-length prefix.

For this assignment:
Upper = SQLStuff;

RPG does something like this:
if length part of SQLStuff > maximum length of SQLStuff
issue RNX0115
len = length part of SQLStuff
if len > maximum length of Upper
len = maximum length of Upper
length part of Upper = len
%subst(data part of Upper : 1 : len) = %subst(data part of SQLStuff :
1 : len)

-------------------------------------------------------------
Subject: RE: How do I clip a vary length field?
From: Francois Lavoie <Francois.Lavoie@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Jan 2020 00:10:38 +0000

A 4 is missing in the VarChar definition of Upper: Dcl-s Upper Varchar
(128:4);
Because SQLstuff is defined as 4 bytes length

That should resolve the runtime error

Or try this:
Upper = %SubSt(SQLStuff:1:%Size(Upper)); //This will truncate to 128 (not
1024) if needed

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.