Rpgle Interview Questions & Answers

5 avg. rating (100% score) - 5879 votes

Rpgle Interview Questions & Answers

Rpgle runs in Integrated Language Environment and supports longer file/field names. Coding can be done using built-in functions. RPG stands for Report Program Generator, it is a programming language. It is IBM product and used only in IBM i- based systems. It is developed to replace the punched cards system. The latest version is RPG IV which is suitable for modern development. Having experienced in Rpgle is very helpful in giving preference to you. There are number of positions available across all the locations. Wisdomjobs focus on providing interview questions and answers to help you in clearing the interview with ease. Rpgle interview questions and answers are useful to attend job interviews and get shortlisted for job position. Check out interview questions page to get more information.

Rpgle Interview Questions

Rpgle Interview Questions
    1. Question 1. Advantages Of Ile Or Rpg?

      Answer :

      • In RPG it is one step compilation (we will get *PGM object) while in ILE-RPG it is two step compilation (we have to create a *MODULE and then bind that module to a program.
      • In RPG we cannot call a program i.e. recursive call is not supported. While in ILERPG it is supported.
      • Extended Factor 2
      • Length of Factor 1 & 2 is increased to 14 as well as Length of OP-CODE is 10
      • Free format is allowed
      • Built-in-functions are available.
      • In case of ILE we have the concept of ACTIVATION GROUP.
      •  In ILE EPM (Extended Program Model) is implemented while in RPG OPM (original program model)

    2. Question 2. What Is Sub-file?

      Answer :

      It is group of records read from or written to display file in a column format.  It is always a subset of records from physical file hence the name subfile.

    3. Question 3. Sfl And Sflctl ?

      Answer :

      There are the two mandatory key words for subfile program /design. While SFL is used to define Subfile record format while SFLCTL is used to define Subfile Control Record format. And this two are the different parts of sub-file.

    4. Question 4. What Are The Sub File Types?

      Answer :

      There are three types of sub file :

      Load All  - In which all the records from the Physical file or at max. 9999 records are written to subfile. Here sub file size should 9999 or the number of records form PF which ever is less. In this case PAGEUP AND PAGEDOWN is taken care by system. SFLPAG should be less than SFLSIZ.

      Single Page/non-elastic – In this case sub file size (SFLSIZ) must be equal to sub file page (SFLPAG). For example, if SFLSIZ = 10 and SFLPAG = 10, then 10 records from file are written to subfile. In this case PAG

      Expandable/elastic/growing  – In this case SFLSIZ should be grater at least by 1 than SFLPAG.(this is applicable to Load all type also). For example, SFLSIZ = 10 and SFLPAG=9, then 10 records from written the sub file from physical file but only 9 are displayed on screen.

    5. Question 5. What Is Sfldrop And Sflfold?

      Answer :

      These are the two key-words used in sub-file for displaying additional information which cannot fit one line.  SFLFOLD will give view in folded form and SFLDROP will give view in truncated form.

    6. Question 6. What Is Sflcsrrrn And Sflrcdnbr ?

      Answer :

      • SFLCSRRRN will give the RRN of the record where the cursor is positioned.
      • SFLRCDNBR will give the RRN of the First record displayed on the screen at a given time.

    7. Question 7. What Is Sflnxtchg?

      Answer :

      Whenever a record is changed on display file. An MDT is set ON. If an indicator is associated with SFLNXTCHG and it is SETON then READC will read only the changed record. And if the indicator is not associated and it is seton it READC reads all the records from sub-file

    8. Question 8. Reading Records From A Subfile Using Readc?

      Answer :

      With the help of READC opcode we can read only changed records from subfile.

    9. Question 9. Required Key Words For Subfile?

      Answer :

      SFL, SFLCTL, SFLDSP, SFLSIZ, SFLPAG are the mandatory key words. SFLDSPCTL, SFLCLR, SFLINZ, SFLEND  are the optional key words used in subfile.

    10. Question 10. Plist And Klist ?

      Answer :

      PLIST is a list of parameter and KLIST is the list of KEY fields.

    11. Question 11. Position To Particular Record?

      Answer :

      With help of op-code SETLL from RPG/RPGLE, it will position the record pointer just before the required record. Next READ will read that particular record.

    12. Question 12. Lr Indicator And Return Operation?

      Answer :

      LR indicator – It close all the open files, Frees the space and release ODP.

      Return – It dose not close files and dose not release the ODP and passes the control to the calling program / command prompt if the program is called from command prompt.

    13. Question 13. Different Operations On Indicator?

      Answer :

      There are only two operations on indicator those are SETON and SETOFF.

    14. Question 14. What Is The Operation / Op-code To Change In File?

      Answer :

      In RPG/RPGLE with the help of UPDAT / UPDATE op-code.

    15. Question 15. How Do I Insert A Record Into A Database File?

      Answer :

      • In RPG / RPGLE with the help of WRITE op-code.
      • In CL/CLLE we can not insert a record into database file.

    16. Question 16. Two Way Of Deleting Records From File?

      Answer :

      One is DELETE and other with the help of O-Specs ADD/DEL specify DEL.

    17. Question 17. How To Define A Subroutine ?

      Answer :

      With help of two op-code BEGSR(Begin subroutine) ENDSR (End subroutine) and between these two op-codes write the instruction. The whole construct is defined as subroutine.

    18. Question 18. In Case Of Load All Sub-file, If We Type Options And Then Pgdn,pgup , Will Options Be There On The Display / In Subfile?

      Answer :

      Yes. It will retain all the options entered in the previous page.

    19. Question 19. How Will You Take Care Of Multiple Options In Case Sub-file?

      Answer :

      We will have to handle it within the program using a READC in a loop.

    20. Question 20. If We Type Some Options On Screen Out Of Which Some Are Invalid And Pressed Enter, What Should Happen?

      Answer :

      It should process all the valid options before invalid options encounter. Once invalid options is encountered program should stop processing and display error message at the bottom of the screen.

    21. Question 21. How Will You Achieve Position To In Load All Subfile?

      Answer :

      While loading subfile move RRN, KEY VALUE into a two dimensional array.  When a key value is entered into POSITION TO field, having a LOOKUP into an array we can get a corresponding RRN.  Assigning RRN value to SFLRCDNBR and then displaying the sub-file.

    22. Question 22. What Are The Built In Function In Rpgle ?

      Answer :

      • SIZE - Gives the size of the variable or literal
      • PARM – Gives the number of parameter passed to parameter
      • IPADDR - Gives the address of the procedure
      • ADDR - Gives address of the variable
      • TRIM - Trims the right blanks of the string
      • TRIM - Trims the Left blanks of the string
      • REPLACE -  Replaces the specified number of characters from the specified position.
      • SUBST - gives a sub string from a variable   (%SUBST(X:Y:Z)
      • ELEM - Gives number of elements or occurrences
      • INDEX - Change the index of a table or multiple-occurrence data- structure.
      • LEN – Returns the length of value from a field.
      • CHAR – Converts a Numeric filed to character.
      • EOF – End of File.
      • FOUND – If record is Found.

    23. Question 23. How To Print Header If O-specs Are Used In Program ?

      Answer :

      With the help of op-code EXCEPT.

    24. Question 24. What Is *pssr And Infsr?

      Answer :

      It is an exception/error handling routine which is specified in F-Sepcs for a file. INFSR(*PSSR), INFSR is an information subroutine to specify the routine name in  F-specs.

    25. Question 25. How To Go To Pssr?

      Answer :

      Whenever an exception/error occurs and *PSSR is declared in F-specs, it is automatically goes to PSSR.

    26. Question 26. Can We All *pssr If No Exception Occurs? What Happen It Is Called ?

      Answer :

      Yes, Whatever the statements specified are executed.

    27. Question 27. What Is Infds?

      Answer :

      INFDS is a File Information Data Structure.

      • 1  -  8    Character    *FILE                 
      • The first 8 characters of the file
      • 9  -  9    Character   
      • Open indication (1 = open).
      • 10 - 10  Character             
      • End of file (1 = end of file)
      • 11 - 15  Zoned dec   *STATUS          
      • Status code.
      • 16 - 21  Character    *OPCODE  
      • Operation code The first five posi
      • 22 - 29  Character    *ROUTINE 
      • First 8 characters of the procedure
      • 30 - 37  Character                             
      • RPG IV source listing line number

    28. Question 28. How To Determine If The Record Is In Used By Another User ?

      Answer :

      We can determine weather a record is in use bye another user with the help of status code (*STATUS).  If *STATUS = 01218 i.e. record already locked.

    29. Question 29. What Is Procedure?

      Answer :

      A procedure is the set of self contained high level language statements that can perform a particular task and then returns to a caller.

    30. Question 30. How To Define Global Parameter In Ile ?

      Answer :

      Declare a variable with key word EXPORT and while using this variable in another program declare with IMPORT  keyword.

    31. Question 31. What Is The Disadvantage Of Using Global Variable?

      Answer :

      We can not trace out at which point the value of variable is changed.

    32. Question 32. What Is Service Program?

      Answer :

       A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE programs. In many respects it is similar to a subroutine library and procedure library.

      A service program differs from a program in two ways:

      • it does not contain a program entry procedure.  This means that you cannot call a service program using the CALL operation.          
      • A service program is bound into a program or other service programs using binding by reference.

    33. Question 33. What Is Iso Date Format?

      Answer :

      YYYY-MM-DD for other formats refer to IBM manual or ERIS document.

    34. Question 34. If We Tried To Move Year Part Of Iso Date Into A Field Of Length 3, What Will Happen?

      Answer :

      Program crashes, as in case of ISO format it required fields of 4,2,2.

    35. Question 35. How To Avoid Using Indicators In Ile ?

      Answer :

      By using the standard Built In Expressions like %FOUND,%EOF, NOT  %EOF, %BOF, NOT %BOF…etc.

Rpgle Related Tutorials

Rpgle Related Interview Questions

Rpgle Related Practice Tests

Ibm - Rpg Tutorial

All Tutorials

All Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM - RPG Tutorial