I haven't found the issue with this.
I have a subfile with 2 positioning fields on the sflctl rcdfmt. SFLCTL has the overlay keyword as does SFLHEAD. CMDKEY does not.
In the program, I build the sfl, write the cmdkey, write the sflhead, and exfmt sflctl. This works on another program.
This all works fine except that the 2 position to fields are not showing up. I can tab down to them and even enter data in them. They are defined as B for both input/output, no conditioning, no other fields/text on the same line. Any idears why they are not showing up?
Software/Hardware used:
ASKED:
November 21, 2011 10:59 PM
UPDATED:
March 6, 2012 6:15 PM
as does SFLHEAD
Out of curiosity, why do you have a SFLHEAD format? Why wouldn’t you simply use the SFLCTL format? What’s the benefit of using two formats instead of just one?
Tom
Can you post the DDS Source?
Tom, it seems that I tried that before and it didn’t work. I could give it another shot and refresh my memory as to why.
Charlie Brown, enjoy…
Another quirk I just noticed is after positioning, and rolling to the end of the records, then rolling down(page up) the subfile rolls back through. It goes back to the start, hit page up once more, shows the last page again, page up once more, shows the page above that, then back to the last page, all over again.
I don’t remember how or if I can make it stop. This is loading a page at a time, ‘dynamic grow’. So I write 5 records, display, page down is hit, I try to load 5 more, etc. CPF handles rolldown.
Yet one more challenge. This program reads a join logical to load by part number, and reads another join logical to load by description. Isn’t there a ‘newer’ / neater way to do this?
Tom,
and the answer is,,,,
CPD7812 30 1 Message . . . . : Subfile control record overlaps subfile record.
This environment is different than most places. They like and are used to having the positioning fields at the bottom instead of the top of the screen. This is why I seperated the SFLCTL from the Headings.
This is why I seperated the SFLCTL from the Headings.
With positioning at the bottom, that would explain it. The name SFLHEAD was misleading me.
Tom
SFLHead is just headings. SFLCTL is all of the SFL keywords plus the positioning fields at the bottom.
Yeah, they looked at me funny the first time I did a subfile here with position to fields. They were at the top of the screen. They said, uh, let’s make it like the other programs that were developed in the 80′s.
Ok, it pays the same….and you guys have to look at it every day.
Maybe I should make some of these different posts but this is all related.
I am ‘simulating’ a wild card search with logicals and RPGLE.
The user can enter all or the first part of part# and/or description.
Here is what I am doing, I am open for any suggestions on how to do it better/cleaner. SQL is not an option with large data base file.
After reading a record from the file (routine will read from LF by part or LF by Desc), I check the EOF indicator. Then….
* Simulate a wild card search
C If pospart <> *blanks
C eval len = %scan(' ':pospart:1) -1
C If len < 1
C eval len = 1
C endif
C If %subst(avpart:1:len) <>
C %trimR(%subst(pospart:1:len))
C Iter
C Endif
C If posdesc <> *blanks
C eval len = %scan(' ':posdesc:1) -1
C If len < 1
C eval len = 1
C endif
C If %subst(avdes1:1:len) <>
C %trimR(%subst(posdesc:1:len))
C Iter
C Endif
C Endif
C Endif
*
C If posdesc <> *blanks
C eval len = %scan(' ':posdesc:1) -1
C If len < 1
C eval len = 1
C endif
C If %subst(avdes1:1:len) <>
C %trimR(%subst(posdesc:1:len))
C Iter
C Endif
C Endif
*
C ExSr $mov2sfl
C EVAL RRN = RRN + 1
C EVAL Cnt = Cnt + 1
C WRITE sflrcd
*
C ENDDO
It looks like the basic logic can be restated this way without any difference in result (/free):
// Simulate a wild card search If pospart <> *blanks ; len = %len(%trimr(pospart)) ; If %subst(avpart:1:len) <> %subst(pospart:1:len) ; Iter ; Endif ; Endif ; If posdesc <> *blanks ; len = %len(%trimr(posdesc)) ; If %subst(avdes1:1:len) <> %subst(posdesc:1:len) ; Iter ; Endif ; Endif ; ExSr $mov2sfl; ...etc.Tom
Thanks Tom.
Great minds think alike. I had already incorporated that after reviewing the code. Trying to K.I.S.S. Remember that? My first boss preached that. Keep It Simple Stupid.
<Sigh> Another great person gone is my first boss. R.I.P. Daniel Moffat.