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




Sorry about that. Two mistakes in my code:
1. ezdaep_full_t should have the QUALIFIED keyword
2. I misspelled ezdaep_full_t in the LIKEDS. (I had 'exdaep_full_t')

This compiles, if I specify ODBCEXIT as the program name when I compile it.
It also compiles with any program name if I replace "dcl-pi ODBCEXIT;" with
"dcl-pi *n;"

/copy qsysinc/qrpglesrc,ezdaep
dcl-ds ezdaep_full_t template qualified; // Add QUALIFIED
header likeds(EZDSQLF2);
data char(10000); // not sure how big this should be
end-ds;

dcl-pi ODBCEXIT;
allow char(1);
datain likeds(ezdaep_full_t); // Spelling of eZdaep_full_t
end-pi;

dcl-s Upper varchar(128);

Upper = %subst(datain.data : 1 : datain.header.EZDQLSTL);
return;

--
Barbara

------------------------------

message: 5
date: Tue, 21 Jan 2020 07:51:11 -0500
from: C Holko <christopherholko@xxxxxxxxx>
subject: Re: How do I clip a vary length field?

To be up front, I cannot get any of this past the compiler. Correcting one
alert leads me down a rabbit hole I am not qualified to be in.

On Fri, Jan 17, 2020 at 6:51 AM Barbara Morris <bmorris@xxxxxxxxxx> wrote:


I made two mistakes in my code sample. (Double facepalm)
- I should have made exdaep_full_t a template so the compiler would give
an
error if it was used in a calculation
- I should have used datain in the assignment to Upper

Here's a more correct version of my suggestion.

/copy qsysinc/qrpglesrc,ezdaep
dcl-ds ezdaep_full_t template;
header likeds(EZDSQLF2);
data char(10000); // not sure how big this should be
end-ds;

dcl-pi ODBCEXIT;
allow char(1);
datain likeds(exdaep_full_t);
end-pi;

dcl-s Upper varchar(128);

Upper = %subst(datain.data : 1 : datain.header.EZDQLSTL);



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.