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