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



Hi Bill,

Your "To:" address is kind of interesting, the mail rule I have setup for
RPG-L mail list certainly couldn't figure it out.

I tried your scenario on Netshare400.com's TS400 which is currently at V4R5
(don't know PTF level) and I let SDA create the field from a database
reference.  It created a fixed-length 60-byte field. And I got the same
errors you did.  Then I changed the display file field to 62, and compiled
with CVTOPT(*VARCHAR), which compiles just fine.  The problem is that you
are now keying into the 2-byte length data at the beginning of the field,
and when you attempt to use the field, or write it to a file, you get an
error (CPF5035 error code 14 for the write-to-file error). I saw nothing in
the DDS manual about variable length fields, so it looks like we are indeed
stuck with using separate fields for the display file and database file.

Regards,
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax

----- Original Message -----
From: <BG0794@aol.com>
To: <":rpg??????????????
Sent: Monday, October 29, 2001 7:49 PM
Subject: Variable Length Fields in DSPF DDS


>   I wanted to take advantage of the variable length field attribute for a
> number of fields in my database file definition.  These same field(s)
would
> be placed on a display file for both input and output.  A corresponding
RPGLE
> program was written to handle the screen and database I/O.  My problem is
> this.  Lets say the field is defined (in the physical file) with a max
length
> of 60 characters.  The DSPF also refers to this field (again both input
and
> output).  I get a compile error on the field length when using the
> CVTOPT(*VARCHAR).  The field on the DSPF has the length defined as 60, and
> the external definition of the physical file indicates a length of 62.
When
> I don't use the CVTOPT(*VARCHAR), I get a compiler error indicating that
the
> attributes don't match.  In this case the fields from both the DSPF and PF
> are defined as 60 characters.  Is there anyway around this short of using
a
> different field nam on the display file and then moving it in and out for
> display purposes?
>
> Thanks for any insight you may offer.
>
> Bill



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



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.