Link to home
Start Free TrialLog in
Avatar of lamtl354
lamtl354Flag for Hong Kong

asked on

RPG fail to clear subfile content

I've a question regarding of my RPG program: a program that load all fields from logical file CVTC01L1, prompt indicated user to enter customer code located on top of screen, if user presses enter without entering any inputs, the program load all data from CVTC01L1; F3 indicate quit & F12 indiocate cancel/restart the query, my problem is when I press F12, record format containing subfile write on screen, but subfile content remained. A subroutine  called SFLCLR is created and seems execute when I press F12. But I really have no ideas why the contents remain on the screen.

Here's code I used. Could anyone help?
QPSUPRTF836734.txt
QPSUPRTF836734--2-.txt
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

The SFLCLR keyword clears the internal buffer that holds your subfile data. but does not clear the screen itself, as documented here:

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/rzakc/rzakcmst151.htm

Your subfile IS getting cleared, but your program just refills it with the same data, and then redisplays it, so it looks to the user like it is not getting cleardd.  

You need to clear the S#OCOD field (do it in IN1000), or declare it as "I", instead of "B".  Since you don't clear this value, each time your RS0000 routine runs, it refills the subfile with the same data.

Running this program under debug and single-stepping through it would probably help you understand what exactly is happening.  

- Gary Patterson

Check out my EE profile: https://www.experts-exchange.com/M_4382324.html
Avatar of lamtl354

ASKER

Thx "Gary_The_IT_Pro", I've move *BLANK to S#OCOD in IN0000 but result is the same. I'll keep trying....

It looks like, by design, this program will show the "top" of the CVTC01L1 file, not a blank screen, when the S#OCOD is blank.  Sure that isn't what is happening?

Have you run this program under debug to see what is happening?

- Gary Patterson

Check out my EE profile: https://www.experts-exchange.com/M_4382324.html
 
 
ASKER CERTIFIED SOLUTION
Avatar of lamtl354
lamtl354
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No objection to closing the question, but what did you do to fix the  problem?

- Gary