|
Hello Walden, Maybe I'm missing something here but OVERLAY can only overlay a field in the current data structure. I do not see 'dbfld1' defined in the 'ds1' data structure. I think your problem has more to do with OVERLAY than with %SIZE. Exactly what error message is the compiler generating? I would not expect the second example you provide to work because the field being OVERLAYED is in a different data structure ('ds0'). %SIZE will be OK though. Regards, Simon Coulter. //-------------------------------------------------------------- // FlyByNight Software AS/400 Technical Specialists // Eclipse the competition - run your business on an IBM AS/400. // Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 // Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au // // Windoze should not be open at Warp speed. //--- forwarded letter ------------------------------------------------------- > X-Mailer: Internet Mail Service (5.5.2232.9) > Date: Thu, 14 Jan 99 22:47:55 -0500 > From: "Walden Leverich" <walden@techsoftinc.com> > To: "Midrange Mailing List (E-mail)" <midrange-l@midrange.com> > Reply-To: MIDRANGE-L@midrange.com > Subject: Using %SIZE() on database fields in D-Spec > > 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 > dbfld1 > 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. > > -Walden +--- | 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 +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.