Re: Why you shouldn't be afraid to use VARCHAR in RPGLE
Daniel Gross <[email protected]>
| Newsgroups | gmane.comp.lang.as400.rpg |
|---|---|
| Message-ID | <[email protected]> |
Hi Doug, the VARCHAR(%LEN(...)) definitions should even work in 7.3 - at least according to InfoCenter: -> https://www.ibm.com/docs/en/i/7.3.0?topic=length-len-used-its-value So maybe you need to have the definitions of the EXTNAME-DS and the field in the correct sequence. Or try this: dcl-f myFile disk usage(*input); // the original file dcl-ds myType likerec(myFileR) template; // a template from the record format dcl-s vc varchar(%len(myType.field)) inz; // a field length derieved from the template In this case, the template is qualified, but it also doesn't reserve any space - so it doesn't hurt. HTH Daniel > Am 08.12.2025 um 15:56 schrieb DEnglander--- via RPG400-L <[email protected]>: > > Marco, > > I tried what you listed, and it won't compile. I am running V7R4, with TR > 10. What version are you running? > > > This is the line in my program: > > dcl-s p_folder varchar(%len(actclon1)); > > ACTLON1 is a field in file CONTROL. > > I also have this a little further down in the source: > > dcl-ds frf_control extname('CONTROL'); > > I get the RNF3320. What is even more strange in this program, is that I > also have the CONTROL file opened for input in an F spec, and the compiler > still is complaining. But the message appears to show its complaining > about the varchar(%len()), not the actual field definition itself. That is > why I'm thinking I need to maybe have TR 11 installed first. > > Thank you, > > Douglas Englander > Senior Programmer/Analyst > The C. D. Hartnett Company – Corporate Offices > 1-817-594-3813 ext. 1636 > > "CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the attachments accompanying it) contain confidential information belonging to the sender. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of the information is strictly prohibited. Any unauthorized interception of this transmission is illegal under the law. If you have received this transmission in error, please promptly notify the sender by reply e-mail, and then destroy all copies of the transmission." > -- > This is the RPG programming on IBM i (RPG400-L) mailing list > To post a message email: [email protected] > To subscribe, unsubscribe, or change list options, > visit: https://lists.midrange.com/mailman/listinfo/rpg400-l > or email: [email protected] > Before posting, please take a moment to review the archives > at https://archive.midrange.com/rpg400-l. > > Please contact [email protected] for any subscription related questions. > -- This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/rpg400-l or email: [email protected] Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l. Please contact [email protected] for any subscription related questions.