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



Exactly - the same thing happens in RPG - if you set a varying length variable to the value of a fixed length variable, trailing blanks are part of that value, because it was fixed. Same thing, as Scott pointed out, with database - the original values were fixed length, therefore, the entire contents are part of the value.

Vern

Jose Antonio Salazar Montenegro wrote:
Maybe the original spaces are being considered part of the field value.
You could try updating all those fields with their trimmed values using
SQL.

--
Greetings
Antonio Salazar

-----Mensaje original-----
De: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] En nombre de John Allen
Enviado el: Martes, 24 de Noviembre de 2009 05:09 p.m.
Para: MIDRANGE-L@xxxxxxxxxxxx
Asunto: Question about variable length fields

I need to extend the length of a field in a physical file

It currently is 256 byte field

I want to make it 1028 variable length field

So I changed the DDS to specify Length of 1028 with VARLEN(30)
Then I did CHGPF and when I look in the physical file I see that the
length
of the field for all of the existing records is set to
the original fixed length of 256 even though most of the fields are
blank or
only have a few bytes of data in it

New records added are fine

I have tried both CHGPF and CRTPF with CPYF using *MAP *DROP and both
set
the field length of existing records to 256 (old fixed length value)


My question is:

Is there any easy way to change the physical file and get the field
length
set to the length of the actual data in the field as opposed to the old
fixed length?

I suppose I could write a small program to read the old file and write
to
the new file.

But CHGPF or CRTPF with CPYF are so much easier


John



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.