• Subject: Using %SIZE() on database fields in D-Spec
  • From: Walden Leverich <walden@xxxxxxxxxxxxxxx>
  • Date: Thu, 14 Jan 1999 22:47:55 -0500

I am attempting to use the %size() function on a d-spec to define a field in
ILE/RPG. The field in the %size() function is a field that is coming from a
program file. The compiler seems to think that the field does not exist.
However, if I add an externally described data structure to bring in the
field definitions before the %size() function is used everything works fine.
What gives?

This does not work

F file1  IF ....
D ds1    DS  
D   fld1         overlay(dbfld1:%size(dbfld1))  //fld1 overlays last byte of
C .....

However, this works fine.

F file1  IF ....
D ds0  E DS     extname(file1)
D ds1    DS
D   fld1        overlay(dbfld1:%size(dbfld1))

I know the database fields are brought into the program until the I specs
are processed for externally described files, but why would that matter in
this age of multi-pass compilers.

| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].