Most of the time, the operating system does a great job of handling drop or fold for subfiles. However, when control returns to the program and the screen is redisplayed, the drop or fold is lost.
The solution is to use the SFLMODE and SFLCSRRRN keywords in conjunction with the SFLFOLD and SFLDROP keywords. When these keywords are used, a value is re- turned in the variable associated with SFLMODE. The variable contains '0' (or *OFF) for folded mode or '1' (*ON) for dropped mode.
Before initially displaying the screen, move *ON or *OFF to the SFLMODE variable (depending on which mode you want to display first). Then move the variable to the controlling indicator for the SFLFOLD/SFLDROP keywords before displaying the screen. When you need to redisplay the screen, the last status of drop or fold will be in the SFLMODE variable which can be used to reset the indicator. To see the keywords in action, refer to the partial display file in 4 and the partial RPG program in 5.
Before initially displaying the screen, move *ON or *OFF to the SFLMODE variable (depending on which mode you want to display first). Then move the variable to the controlling indicator for the SFLFOLD/SFLDROP keywords before displaying the screen. When you need to redisplay the screen, the last status of drop or fold will be in the SFLMODE variable which can be used to reset the indicator. To see the keywords in action, refer to the partial display file in Figure 4 and the partial RPG program in Figure 5.
Hold the Drop or Fold
Figure 4 Using SFLMODE in a Display File
*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A R CONTROL SFLCTL(SUBFILE) A SFLSIZ(0011) A SFLPAG(0010) A SFLMODE(&SFLMOD) A SFLCSRRRN(&RELRCD) A SFLDSP A SFLDSPCTL A 60 SFLDROP(CF11) A N60 SFLFOLD(CF11) A SFLMOD 1A H A RELRCD 5S 0H *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
Hold the Drop or Fold
Figure 5 Retaining Fold or Drop in RPG
*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 C MOVE *ON SFLMOD Start with drop C MOVE *OFF SFLMOD or fold C* C *IN03 DOUEQ*ON C MOVE SFLMOD *IN60 Reset drop/fold C EXFMTCONTROL C ENDDO *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
LATEST COMMENTS
MC Press Online