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



Booth Martin wrote:
> 
> I know how to find the length manually.   It is shown in the compile of the
> RPG program.  What I actually do is just make the field overly long, say 600
> for example.
> 
> However that's not quite the problem I wish to solve.  I want the DDS to not
> need to be corrected if the data file has a field changed or added.  You
> know, the same reasons that we use REFFLD and REF, right?  It isn't a
> serious issue but it is the only glitch I haven't been able to  get around.
> 

You could put a size check in your programs:

     if %size(sflField) < %size(datafileDs)
        // if this crashes, then sflField needs to be expanded
        crash - divide by zero or send an escape message or something
     endif

You could also code a check that would fail at compile time.  A bit
kludgy, but maybe better than waiting for a runtime error.

 // This structure ensures that datafileDs is at least
 // as big as sflField.
 // If it gets an error about overlay too big, 
 // then sflField needs to be expanded
D chkSize     ds            based(dummy)
D   dsSize                  like(datafileDs)
D   sflSize                 like(sflField) overlay(dsSize)


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.