IBM I Training Assignment
IBM I Training Assignment
IBM I Training Assignment
Questions
Ans: AS400
Ans:
Ans:
Ans: GO LICPGM
Ans:
Ans: WRKOBJ Command shows a list of objects from one or more libraries
Ans: QSYS
Ans:
Questions
Ans: CRTLIB
Ans: DSPLIB
EDTLIB? Ans:
Ans:
Physical file
1.Occupies the portion of memory. It contains the original data.
2.Can exist even without LF.
3.If there is a logical file for a PF, the PF can’t be deleted until and unless we delete
the LF.
Logical file
1.Does not occupy any memory space. Does not contain any data. It loads itself at
run time as per the defined access path.
2.Can’t exist without PF.
3.If there is a logical file for a PF, the LF can be deleted without deleting the PF.
Ans:
Ans: 10000
8. What is access path? Describe its types-Keyed andsequential.
Ans:
9. What can be done if we want to compile the file without losing thedata?
Ans:
Session Name: SEU Session.
Questions
Ans: STRPDM,STRSEU,WRKPDM
Ans: shift+F5
Ans: shift+f3
4. If you are in edit mode of source then what can be used for system
command prompt? (oneword)
Ans:
Ans:To copy the lines between (and including) this line and the next occurrence of
CCR to another location and retain the CCR command in the sequence area of the
display for repeated copy operations.
Ans: Delete n lines Delete the current line and the next n-1 lines
Ans: Find all occurrences of a character string and replace it with another string.
Session Name: File handling in RPGLE
Questions
Ans.
2. What is the factor 1 argument of opcode setll, if file pointer should startfrom
lowest keyvalue?
Ans.
3. Which opcode is used to read the record from a file, at which file pointer isset?
Ans.
4. Which Built-in function is used to check whether the end of file is reached or
not?
Ans.
Ans.
Ans.
7. Which opcode is used to read the record after matching the key value offile,
with the factor 1 argument of thatopcode?
Ans.
8. Which opcode is used to write a record to the file and what should be in the
factor 2 argument of thatopcode?
Ans.
Ans.
Session Name: Opcode extenders
Questions
1. Write a rpgle program to handle divide by zero error. (By using monitor
with on-error or by *PSSRsubroutine)?
2. Write a rpgle program to validate a date field. (Use test(de) & %error,i.e.:
cannot put32-01-2021)
Ans: /FREE
READ INREC; // read a record
IF %EOF; // handle end of file
ENDIF;
/END-FREE
4. What is the opcode extender to handle error for without setting pointer in pfand
trying to read or update thePF?
Ans:
Ans:
SessionName: RPGLE Opcodes.
Questions
Ans:
a) Div
b) Sqrt
Ans:.
Ans:
Ans:
Ans:
6. Name the opcode which represents the beginning and ending of aSubroutine.
Ans:
Session Name: Rpgle Opcodes.
Questions
1. We have aString:
Ans.
Ans.
*Addition.
*Subtraction.
* Multiplication.
Ans.
Ans.
Ans.
Ans.
Session Name: Conditional Statement
Questions
Output: 1,2,3..................20
Output: 1, 2, 5, 7 . . . . . .
Output: 2, 4, 6 . . . . . . .
Output: 1, 3, 5 . . . . . .
6. Create belowpattern.
**
***
****
7. Create belowpattern.
* ***
*****
8. Create belowpattern.
****
***
**
*
Session Name: Display File
Questions
Ans.
Ans.
3. Create a program to update data into file using Display screen? (Hint: UseChain
in program)
Ans.
4. Create a program to delete data into file using Display screen? (Hint: Use
Chain in program)
Ans.
Ans.
Ans.
Ans.
Ans.
10. Drop letter alphabetically from String and write in other String at same
position:
Input: Enter the string: virag
vir_g :a_
vir:ag v_r:
_i_ag v:_irag
: virag (output)
Session Name: Coding Standards in RPG
Questions
1. Create a physical file and logical file by using the proper coding standardsfor
file and field name. (Write readable and efficientcode)
Ans.
2. Write a basic program of file handling and try to use comments and
proper documentation with proper codingformat.
Ans.
3. Write a basic program for using Built-in function and qualify the name of file
with built-in function. (Ex: %found,%Eof)
Ans.
Ans.
Ans.
Ans.
Ans.
Ans
Session Name: RPG Indicator and Parameter Passing
Questions
Ans.
Ans.
Ans.
Ans.
Ans.
6. How we can call another program from one program and pass parameters
(describe byexample)?
Ans
Session Name: Subfile File
Questions
Ans.
Ans.
Ans.
Ans.
Q5. Create a subfile and its program, to display all records of physical file.?
Ans.
Session Name: Subfile and Window and Message subfile
Questions
Ans.
Q2. Create a subfile performing edit, add and delete records from a physical file on
it.
Ans.
Ans.
Ans.
Ans.
Ans.
Ans.
Ans.
Q9. Create a message subfile and show all the error messages (blank field
validation) in Question2 using message subfile.
Ans.
Session Name: Array and Data Structure
Questions
Ans.
Ans.
Q3. What is the important opcode and built-in function used in array?
Ans.
Ans.
Ans.
Q6. Explain the use of Lookup, Sorta opcode. Write a sample program using
lookup and sorta opcode or built-in function?
Ans.
Ans.
Ans.
Ans.
Session Name: Introduction to DB2 SQL.
Questions
(Ex: If table is containing 5 fields, write a query to insert the record for any 2
fields)
Questions
Str=’123grammers’
5: Write a query to select customer name and its item purchased having Order ID
ORD002.
Order Table
Customer Table
6: Write a query to join tables- order and customer using left join.
7. How Do You Retrieve the First 5 Characters of First name Column of Db2
Table Emp? Write a query forthat.
Questions
1. Fetch the records from a physical file using SQLRPGLE (Coding Style : Fix
Format)
Ans:
Ans:
Ans:
4. What are special registers, create one program and use special registers init?
Ans:
5. Delete the records from physical file using sql prepare and executestatements.
Ans:
Ans:
7. Create one program to fetch the records from physical file using the conceptsof
cursors.
Ans:
Ans:
Ans:
Prepared by: Programmers.io