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



Thanks!  That clears it up.  I guess I assumed that DSPPFM would show
the actual offsets within the record, based on the length of the
varying fields.  I am getting x'0034', or 52, which is the correct
length.

I am glad the VARLEN and VARYING keywords work like that.  


On Mon, 10 Jan 2005 17:27:54 -0500, Barbara Morris <bmorris@xxxxxxxxxx> wrote:
> Tony Carolla wrote:
> >
> > I am writing to a file, and one of the fields is a 150 Alpha VARLEN
> > field.  This file will contain a large number of history records, and
> > I am doing this to conserve space:
> > ...
> > In debug, I see that the DS has the correct length set (52) using %Len
> > to test the length.  But when I write, the field in the DB file
> > contains all 150 characters, with trailing spaces added.  Is there a
> > trick to making the WRITE op recognize the DS variable length, that
> > the compiler created for me, based on the file structure, or do I have
> > to eval %Trim from the DS to the actual file buffer fields?
> >
> 
> How are you determining the actual data in the file?  If you're using
> DSPPFM, the position of the other fields in the record will be fixed, so
> DSPPFM has to show something in those unused bytes.  Try doing F10 F11
> to see the hex value of the record, so you can see the 2-byte length
> part of the varying field.
> 
> For this file:
> A          R REC
> A            FLD1          10A
> A            FLD2          10A         VARLEN
> A            FLD3          10A
> 
> My record has values FLd1='aaaaaaaaaa', FLD2='bbb', and
> FLd3='cccccccccc'.
> 
> DSPPFM and it shows this:
>         aaaaaaaaaabbb       cccccccccc
> 
> With F10 then F11, it shows this.  The xx marks the 2 length bytes for
> FLD2 (value x'0003' = 3).
>                   xx
>         aaaaaaaaaabbb       cccccccccc
>         88888888880088844444448888888888
>         11111111110322200000003333333333
> 
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
> 


-- 
"Enter any 11-digit prime number to continue..."

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.