Hi,
Blank report
I received your attachements and tried to understand why the program without the overlay keyword worked and produced a blank report when this keyword was in use.
This is what I came up with: in fact it doesn't work because the overlay kwd applies on the DS statement itself and not on a subfield inside the DS instead.
D TKREC E DS EXTNAME(@TKL050)
D OPNDAT 6 OVERLAY(TKREC:493) These statements are wrong and produce bad results because the field OPNDAT overlays the DS TKREC and not a subfield in the DS. I presume that the overlay doesn't take place and makes all the fields blanks on the record ?
On the other hand, the Manual says "This keyword is allowed only for data structure subfields" and therefore the compiler should have detected an error.
SQL vs. native read
- @TKL050 keyed on TKOPNC, .Y,.M,.D
- Change this SQL stm (much overhead I think)"WHERE TKOPNC * 1000000 + TKOPNY * 10000 + TKOPNM * 100 TKOPND..." against "WHERE
DIGITS(TKOPNC) !! DIGITS(TKOPNY) !! DIGITS(TKOPNM) !!
DIGITS(TKOPND)..."
Give it a try and let us know, will you ?
Philippe