× 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 John,

It seems to me that these commands are doing exactly what you asked them to do. You told it to copy the data from one file to another, and to map the values into the fields with the same names. (i.e. *MAP)

It did that.

If the old file had a field with 256 blanks in it, the new file also has a field with 256 blanks in it. If the old file had a field with 50 non blank characters, followed by 206 blank characters, the new file has the same thing.

You seem to think that this isn't a logical result -- but to my mind, it's perfectly logical. Blanks are characters, too. And should be treated the same as any other characters.

If your goal is to trim blanks from the field, why not just run a simple SQL statement?

UPDATE MYFILE SET MYFIELD=TRIM(MYFIELD)

Seems to me that this would be a one-time shot if your programs are writing the new data correctly...



John Allen wrote:
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.