Ü  Expandable/elastic/growing Subfile

·         In this case each time the subfile buffer is loaded with SFLPAG size. But unlike single page the buffer is not cleared before writing the new data. Hence as a result the buffer size starts growing.

·         if first time we have loaded 10 records from the Physical file to subfile buffer then second time the size of the buffer will be 10 +10, 3rd time the size of subfile buffer will be 10+10+10…. and so on. Due to the growing nature of this subfile, we also call is growing or elastic subfile.

·         In this case SFLSIZ should be at-least 1 greater than the SFLPAG.

·         If we are writing more records in the subfile buffer than the SFLSIZ declared and SFLSIZ<9999, then the SFLSIZ is extended to accommodate all records till the size of 9999. 9999 is the buffer limit.

·         In this PAGEUP handling is not required as it is taken care by the system itself. Only PAGEDOWN handling is required.

·         In Expandable subfile after PAGE UP if we press ENTER, then the page that is displayed on the screen is that we had at our  last  PAGEDOWN. i.e. suppose we are on page-3 after pressing 2 PAGEDOWN. From page-3 if we press 1 PAGEUP and then press ENTER, the page to be displayed should be the 2nd page, but it is not the case. In this case, the page that is displayed after pressing ENTER is 3rd page which is the page no. that we got after the latest PAGEDOWN activity. To avoid this situation, we use file information data structure to get the current page RRN number and pass it to the SFLRCDNBR hidden field defined in the display file DDS.

Ü  Expandable Subfile Example

 

 

Physical file used in the program = MASTER

 

ORG CODE  ACC NUMBER    CURRENCY  OPEN DATE  PARTY NUM     A/C STS  ENT STS  VER STS  AUT STS  REC STS  TIMESTAMP
190    A00000000001    EUR      20120605  P00000000001     2        1        1        1        2     2012-06-05-03.07.34.011000
190    A00000000002    USD      20120605  P00000000002     3        1        1        1        2     2012-06-05-03.07.49.859000
190    A00000000004    EUR       1072012  P00000000004     2        2        1        1        2     0001-01-01-00.00.00.000000
190    A00000000005    USD       6072011  P00000000005     1        1        1        1        1     0001-01-01-00.00.00.000000
191    A00000000006    USD       9082012  P00000000006     2        1        1        1        1     0001-01-01-00.00.00.000000
191    A00000000007    EUR       9082000  P00000000007     2        1        1        1        1     0001-01-01-00.00.00.000000
191    A00000000008    USD       9082007  P00000000008     1        1        1        1        1     0001-01-01-00.00.00.000000
192    A00000000009    TRY       6092000  P00000000009     2        2        2        2        2     0001-01-01-00.00.00.000000
192    A00000000010    INR       1012012  P00000000001     2        1        1        1        2     0001-01-01-00.00.00.000001
192    A00000000011    INR       1012022  P00000000012     1        2        1        1        2     0001-01-01-00.00.00.000021
192    A00000000012    INR       1012022  P00000000002     2        2        1        1        2     0001-01-01-00.00.00.000011
********  End of data  ********



Display file used in the program = EXPD_DSP

 


Columns . . . :    1  80                  Browse                         AMIT/QRPGLESRC
SEU==>                                                                         EXPD_DSP
FMT DP .....AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions+++++++++++++++++++++++++++
*************** Beginning of data *****************************************************
0001.00      A                                      DSPSIZ(24 80 *DS3)
0002.00      A                                      CA03(03 'EXIT')
0003.00      A                                      PAGEDOWN(66)
0004.00      A          R HEADER
0005.00      A                                      OVERLAY
0006.00      A                                  1  3USER
0007.00      A                                      DSPATR(HI)
0008.00      A                                      COLOR(BLU)
0009.00      A                                  1 71DATE
0010.00      A                                      EDTCDE(Y)
0011.00      A                                      DSPATR(HI)
0012.00      A                                      COLOR(BLU)
0013.00      A                                  2 71TIME
0014.00      A                                      DSPATR(HI)
0015.00      A                                      COLOR(BLU)
0016.00      A                                  1 23'DISPLAY THE EXPANDIBLE SUBFILE'
0017.00      A                                      DSPATR(HI)
0018.00      A                                      COLOR(BLU)
0019.00      A          R FOOTER
0020.00      A                                      OVERLAY
0021.00      A                                 23  7'F3'
0022.00      A                                      DSPATR(RI)
0023.00      A                                      COLOR(WHT)
0024.00      A                                 23 10'= EXIT'
0025.00      A                                 23 26'F12'
0026.00      A                                      DSPATR(HI)
0027.00      A                                      DSPATR(RI)
0028.00      A                                 23 30'=PREVIOUS'
0029.00      A          R EXPD_SFL                  SFL
0030.00      A  56                                  SFLNXTCHG
0031.00      A            S_ORG          3S 0O  8 12
0032.00      A            S_ACC         12A  O  8 28
0033.00      A            S_CCY          3A  O  8 49
0034.00      A          R EXPD_CTL                  SFLCTL(EXPD_SFL)
0035.00      A                                      TEXT('Y')
0036.00      A                                      OVERLAY
0037.00      A  52                                  SFLDSP
0038.00      A  51                                  SFLDSPCTL
0039.00      A  50                                  SFLCLR
0040.00      A  45                                  SFLEND(*MORE)
0041.00      A                                      SFLSIZ(0006)
0042.00      A                                      SFLPAG(0005)
0043.00      A            FIRSTRRN       4S 0H      SFLRCDNBR(CURSOR)
0044.00      A                                  6 12'ORG CODE'
0045.00      A                                  6 27'ACCOUNT NUMBER'
0046.00      A                                  6 48'CURRENCY'
****************** End of data *******************************************************




MAIN PROGRAM

 


Columns . . . :    6  80                     Browse                     AMIT/QRPGLESRC
SEU==>                                                                      EXPD_RPGLE
FMT *   *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
*************** Beginning of data ****************************************************
0001.00                                                                                
0002.00 HDEBUG(*YES)                                                                    
0003.00 HOPTION(*NODEBUGIO)                                                            
0004.00  *                                                                             
0005.00 FMASTER    IF   E           K DISK                                              
0006.00 FEXPD_DSP  CF   E             WORKSTN                                          
0007.00 F                                     SFILE(EXPD_SFL:RRN)                      
0008.00 F                                     INFDS(infds)                             
0009.00  *                                                                             
0010.00 Dinfds            DS                                                           
0011.00 DRECNO                  378    379I 0                                          
0012.00  *________________________________________________________________________     
0013.00  *______ In Expandable subfile after PAGE UP if we press ENTER, then           
0014.00  *______ the page displayed on the screen is the page that we had at our last   
0015.00  *______ PAGEDOWN activity. E.g.- Suppose we are on page-3 after pressing 2     
0015.01  *______ PAGEDOWN. From page-3 if we press 1 PAGEUP and then press ENTER, the  
0015.02  *______ page to be displayed should be the 2nd page, but it is not the case.   
0015.03  *______ In this case, the page that is displayed after pressing ENTER is 3rd   
0015.04  *______ page which is the page no. that we got after the latest PAGEDOWN       
0015.05  *______ activity. To avoid this situation, we use file information data        
0015.06  *______ to get the current page RRN number and pass it to the SFLRCDNBR        
0015.07  *______ hidden field defined in the display file DDS.                          
0016.00  *________________________________________________________________________     
0017.00  *                                                                             
0018.00 DNXTPGCOUNT       s              2P 0 INZ(*ZEROS)                              
0019.00 DFIRSTRRN         s              4P 0 INZ(*ZEROS)                               
0020.00 DLSTPAGCNT        s              2P 0 INZ(*ZEROS)                              
0021.00  *                                                                             
0022.00                                                                                 
0023.00 C     *IN03         DOWEQ     *OFF                                             
0024.00 C                   EXSR      MAIN                                             
0025.00 C                   EXSR      DSPSFL                                           
0026.00 C                   ENDDO                                                      
0027.00 C                   SETON                                            LR         
0028.00 C*_____________________________________________                                
0029.00                                                                                
0030.00 C*_________MAIN SUBROUTINE BEGINS HERE_________                                
0031.00 C*_____________________________________________                                
0032.00 C     MAIN          BEGSR                                                      
0033.00 C*                                                                              
0034.00 C*_________PAGE UP HANDLING IS NOT NEEDED______                                
0035.00 C*                                                                             
0036.00 C*                                                                             
0037.00 C*__________________PAGE DOWN__________________                                
0038.00 C*_____________________________________________                                 
0039.00 C     *IN66         IFEQ      *ON                                              
0040.00 C                   IF        *IN45=*OFF                                       
0041.00 C                   EXSR      NXTPAG                                           
0042.00 C                   EXSR      FILSFL                                           
0043.00 C                   ENDIF                                                      
0044.00 C                   SETOFF                                       66            
0045.00 C                   ELSE                                                       
0046.00  *____Handle ENTER KEY after PAGE UP situation here                             
0047.00 C     *IN66         IFEQ      *OFF                                             
0048.00 C     *IN03         ANDEQ     *OFF                                             
0049.00 C                   EVAL      FIRSTRRN=RECNO                                   
0050.00 C                   ENDIF                                                      
0051.00 C                   ENDIF                                                      
0052.00 C*                                                                             
0053.00 C                   ENDSR                                                      
0054.00 C*_________________________________________________                             
0055.00 C*_______________NXT PAGING________________________                            
0056.00 C*_________________________________________________                            
0057.00 C     NXTPAG        BEGSR                                                       
0058.00 C                   EVAL      NXTPGCOUNT=0                                     
0059.00 C                   DO        SFLPAG                                           
0060.00 C                   READ      REC1                                             
0061.00 C                   IF        %EOF(MASTER)                                     
0062.00 C                   EVAL      LSTPAGCNT=NXTPGCOUNT                              
0063.00 C     *HIVAL        SETLL     REC1                                             
0064.00 C                   LEAVE                                                      
0065.00 C                   ENDIF                                                       
0066.00 C                   EVAL      NXTPGCOUNT=NXTPGCOUNT+1                          
0067.00 C                   ENDDO                                                      
0068.00 C                   DO        NXTPGCOUNT                                       
0069.00 C                   READP     REC1                                             
0070.00 C                   ENDDO                                                      
0071.00 C                   IF        NXTPGCOUNT9999                                         
0116.00 C                   LEAVE                                                       
0117.00 C                   ENDIF                                                      
0118.00 C                   WRITE     EXPD_SFL                                         
0119.00 C                   ENDDO                                                       
0120.00 C                   ENDSR                                                      
0121.00 C*_________________________________________________                            
0122.00 C*                                                                             
0123.00 C     DSPSFL        BEGSR                                                      
0124.00 C                   SETON                                        5152          
0125.00  * - - - Handle session device error if RRN<=0 i.e. no data in the buffer      
0126.00 C                   IF        RRN<=0                                           
0127.00 C                   SETOFF                                       52            
0128.00 C                   ENDIF                                                      
0129.00  *                                                                             
0130.00 C                   WRITE     HEADER                                           
0131.00 C                   WRITE     FOOTER                                           
0132.00 C                   EXFMT     EXPD_CTL                                          
0133.00 C                   SETOFF                                       5152          
0134.00 C                   ENDSR                                                      
****************** End of data *******************************************************




 

 

OUTPUT

 


  AMIT             DISPLAY THE EXPANDABLE SUBFILE                      2/21/13 
                                                                      08:07:59 
                                                                               
                                                                                
                                                                               
           ORG CODE       ACCOUNT NUMBER       CURRENCY                        
                                                                                
           190             A00000000001         EUR                            
           190             A00000000002         USD                            
           190             A00000000004         EUR                            
           190             A00000000005         USD                            
           191             A00000000006         USD                            
                                                                        More...
                                                                                
                                               
  F3 = EXIT          F12 =PREVIOUS         














User Comments:



Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy