Problem solve Get help with specific problems with your technologies, process and projects.

Clearing subfiles

I know this is an old one. Does anyone remember why subfile records won't actually clear from the subfile screen even though the proper indicators are set, and you cannot rollup or down because the subfile records aren't really there?
You need to write a format over the space on the screen occupied by the subfile. Do this when there are no records in the subfile. The format looks like this:

A          R D@NDT1                     TEXT('No data in subfile') 
A                                       OVERLAY PUTOVR             
A                                 12 30' '              

The line number must be within the subfile start/end line range. The blank constant could be an actual field, and it does not have to be blank (if you use a field with PUTOVR specified at the record level, specify OVRDTA at the field level).

The code would look something like this (where indicator *In14 is OFF if the subfile is empty) :

C                   Write     D@FOOT                                     Footer 
C                   Write     D@MSGCTL                                   Messages 
C  N14              Write     D@NDT1                                     No Subfile 
C                   Exfmt     D@SF1C                                     Screen 


The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

Dig Deeper on iSeries programming commands