as400 interview questions and answers-Part 13


1. What is OVERLAY keyword in as400? Explain this keyword with example.

Ans:

OVERLAY

 

·         This display file keyword is used at record level to specify that the record is displayed on the screen without completely erasing the previous displayed screen.

·         Suppose we have 3 records on the display screen: HEADER, DETAIL and FOOTER, Where HEADER contains the content/data of the top part of the screen; DETAIL contains the content of data part and FOOTER contains the content of FOOTER part. Now if we want to write all the screens at the same time and want to display the content that it is containing then we go for overlay keyword. We put overlay keyword on the DETAIL and FOOTER and do the operation as below in our program:

 

WRITE HEADER

WRITE DETAIL

WRITE FOOTER

READ HEADER

 

 

 

Example

 

 


Columns . . . :    1 100                Browse                     IROBO1/QRPGLESRC
 SEU==>                                                                        DSP2
 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          R HEADER
0004.00      A                                  3 27'ACCOUNT REALATED INFORMATION'
0005.00      A                                  3  1USER
0006.00      A                                  3 73DATE
0007.00      A                                      EDTCDE(Y)
0008.00      A                                  4 73TIME
0009.00      A          R DETAIL
0010.00      A                                      OVERLAY
0011.00      A                                  7 14'PARTY NUMBER....'
0012.00      A                                  8 14'ORG CODE........'
0013.00      A                                  9 14'ACCOUNT NUMBER..'
0014.00      A                                 10 14'CURRENCY........'
0015.00      A            S_PARTY       12A  O  7 34
0016.00      A            S_ORG          3S 0O  8 34
0017.00      A            S_ACC         12A  O  9 34
0018.00      A            S_CCY          3A  O 10 34
0019.00      A          R FOOTER
0020.00      A                                      OVERLAY
0021.00      A                                 23  2'F3 = EXIT'
        ****************** End of data *********************************************





Columns . . . :    6 100                Browse                       IROBO1/QRPGLESRC
 SEU==>                                                                          RPG2
 FMT FX FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++Comments++++++++++++
        *************** Beginning of data *******************************************
0001.00 FACCOUNT   IF   E           K DISK
0002.00 FDSP2      CF   E             WORKSTN
0003.00  *
0004.00 C                   DOW       *IN03=*OFF
0005.00 C   03              LEAVE
0006.00 C                   READ      ACCOUNT
0007.00 C                   IF        %EOF(ACCOUNT)
0008.00 C                   LEAVE
0009.00 C                   ENDIF
0010.00 C                   EVAL      S_PARTY=PARTY
0011.00 C                   EVAL      S_ORG=ORG
0012.00 C                   EVAL      S_ACC=ACC
0013.00 C                   EVAL      S_CCY=CCY
0014.00 C
0015.00 C                   WRITE     HEADER
0016.00 C                   WRITE     DETAIL
0017.00 C                   WRITE     FOOTER
0018.00 C                   READ      HEADER
0019.00 C                   ENDDO
0020.00 C                   SETON                                        LR
        ****************** End of data *********************************************



 



IROBO                     ACCOUNT REALATED INFORMATION                   4/05/13
                                                                        19:50:23
                                                                               
                                                                               
             PARTY NUMBER....    P00000000001                                  
             ORG CODE........    190                                           
             ACCOUNT NUMBER..    A00000000001                                  
             CURRENCY........    CCY                                            
                                                                               


                                                                               
 F3 = EXIT                                                                      

 

 

 

2. What is SFLCSRRRN in AS400? Explain SFLCSRRRN with example.

Ans:

SFLCSRRRN

 

·         This keyword is used at record level to provide the relative record number (RRN) of the record on which cursor is placed.

For more explanation and example of SFLCSRRRN, please refer:            Click here..

 

3. What is SFLFOLD,SFLFOLD and SFLMODE keyword in display file? Explain with example.

Ans:

 

SFLDROP

 

·         This keyword is used at record level to display the subfile in truncated form i.e. the subfile records are truncated to fit on one display line.

·         We assign a CA (command attention) or CF (command function) key to control the truncated and folded behavior of subfile by pressing the function key.

·         By default the display mode be truncated one but when the user presses the function key it goes to folded mode.

·         The operator presses the specified CF or CA key to switch from truncated form to folded form or from folded form to truncated form. It is used along with the keyword SFLMODE and SFLFOLD.

 

SFLFOLD

 

·         This keyword is used at record level to display the subfile in folded form by default.

·         We assign a CA (command attention) or CF (command function) key to control the truncated and folded behavior of subfile by pressing the function key.

·         By default the display mode is folded one but when the user presses the function key it goes to truncated mode.

·         The operator presses the specified CF or CA key to switch from folded form to truncated form or from truncated form to folded form. It is used along with the keyword SFLMODE and SFLDROP.

 

SFLMODE

·         This keyword is used at record level to set the mode of the subfile i.e. to control if the subfile is to be displayed in folded or truncated form.

·         We use a hidden variable as a parameter of this keyword to control the behavior of the subfile by setting the value of the hidden variable.

·         The operator presses the specified CF or CA key to switch from truncated form to folded form or from folded form to truncated form. By default the display mode be truncated one.

·         It is used along with the keyword SFLDROP and SFLFOLD.

Example


Columns . . . :    1  71           Browse                        AMIT/QRPGLESRC
 SEU==>                                                               EDTDSPCCC
 FMT DP .....AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++++++++++
0003.00      A          R EXPD_CTL                  SFLCTL(EXPD_SFL)           
0003.10      A  43                                  SFLDSP                     
0003.20      A  42                                  SFLDSPCTL                  
0003.30      A  41                                  SFLCLR                     
0003.40      A  45                                  SFLEND(*MORE)              
0003.50      A                                      SFLSIZ(9999)               
0003.60      A                                      SFLPAG(0005)               
0003.61      A                                      SFLMODE(&MODE)             
0003.63      A  77                                  SFLDROP(CF11)              
0003.64      A N77                                  SFLFOLD(CF11)              
0003.65      A            MODE           1A  H                                 
0003.70      A                                  8  5'OPT   PARTY NAME     PARTY
0003.80      A                                      COLOR(BLU)                  
0003.90      A                                  8 45'PARTY ADDRESS'            
0004.00      A                                      COLOR(BLU)                 
0004.20       *                                                                 
0004.30      A          R FOOTER                    OVERLAY                    


 

Here, to control the mode option indicator 77 is used. By pressing F11 we can toggle from SFLDROP state to SFLFOLD mode.

 

 


0008.03 C                   SELECT
0008.04 C     S_OPT         WHENEQ    '1'
0008.05 C                   EXSR      OPTION1
0008.06 C     S_OPT         WHENEQ    '2'
0008.07 C                   EXSR      OPTION2
0008.08 C     S_OPT         WHENEQ    '4'
0008.09 C                   EXSR      OPTION4
0008.10 C     S_OPT         WHENEQ    '5'
0008.11 C                   EXSR      OPTION5
0008.12 C                   OTHER
0008.13 C                   EXSR      VALIDATE
0008.14 C                   ENDSL
0008.15 C                   READC     EXPD_SFL
0008.16 C                   ENDDO
0008.18 C                   EVAL      MODE='1'
0009.00 C                   ENDSR
0010.00  *______________________________________________
0011.00  *___DSPLY SUBROUTINE BEGINS HERE_______________
0012.00 C     DSPLY         BEGSR
0012.01 C                   EXSR      CLRSFL
0012.02 C                   EXSR      FILSFL
0012.03 C                   EXSR      DSPSFL
0013.00 C                   ENDSR
 
 
0015.00 C     DSPSFL        BEGSR
0015.02 C                   SETON                                        4243
0015.03 C                   IF        *INKJ=*ON
0015.04 C                   MOVE      MODE          *IN77
0015.05 C                   ENDIF
0015.06 C                   WRITE     EXPD_CTL
0015.07 C                   WRITE     HEADER
0015.08 C                   WRITE     FOOTER
0015.09 C                   READ      EXPD_CTL
0015.10 C                   SETOFF                                       4243
0016.00 C                   ENDSR

 

 

 


OUTPUT

 

The output will be displayed in the folded mode initially.

 


AJAISWAL               DISPLAY THE EDITABEL SUBFILE                 11/05/13  
                                                                      5/53/29  
                                                                               
                                                                               
    OPTION: 1 = NEW A/C ENTRY FOR PARTY, 2=EDIT, 4 = DELETE, 5 =DISPLAY        
                                                                                
                                                                               
    OPT   PARTY NAME     PARTY NUMBER       PARTY ADDRESS                      
          IROBO          P00000000001       CHENNAI                            
          00000000000000000001                                                 
          IROBO          P00000000002       EMPHAL                             
          00000000000000000002                                                  
          SHMANT         P00000000003       CHENNAI                            
          00000000000000000003                                                 
          AFTAB          P00000000007       HOMEIIEA                           
          00000000000000000004                                                 
          AMI            P00000000008       HELLY CORN                         
          00000000000000000005                                                  
                                                                        More...
                                                                               
                                                                                
                                                                               
  F3 = EXIT                                                                    

 

 

After we press F11, We go to the truncated mode as shown below:

 


AJAISWAL               DISPLAY THE EDITABEL SUBFILE                 11/05/13  
                                                                      5/53/29  
                                                                                
                                                                               
    OPTION: 1 = NEW A/C ENTRY FOR PARTY, 2=EDIT, 4 = DELETE, 5 =DISPLAY        
                                                                                
                                                                               
    OPT   PARTY NAME     PARTY NUMBER       PARTY ADDRESS                      
          IROBO          P00000000001       CHENNAI                             
          IROBO          P00000000002       EMPHAL                             
          SHMANT         P00000000003       CHENNAI                            
          AFTAB          P00000000007       HOMEIIEA                            
          AMI            P00000000008       HELLY CORN                         
          JPY            P00000000009       JEKINSAN                           
          SHANN          P00000000010       KUPUNUS                            
          HAPART         P00000000011       KOLINSA                            
                                                                               
                                                                               
                                                                         Bottom
                                                                  
                                                                                
  F3 = EXIT                                                                    

 

 

 

4. What is SFLINZ and SFLRNA keyword in display file? Explain SFLINZ and SFLRNA keyword with example.

Ans:

 

SFLINZ and SFLRNA

 

·         These two keyword is used to initialize a subfile which is done in case we want to make a data entry screen.

·         After the entry is made to be the subfile then only it becomes active, before that it will be inactive. This is done by SFLRNA.

·         By using SFLINZ, the fields in each subfile record are initialized like as below:

CHARèBLANKS

NUMEèZEROS

FLOATèNULLS

For more explanation and example of  SFLINZ and SFLRNA, please refer: Click here...

 



 

 







User Comments:



Subscribe

.  


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