IBM I Training Assignment V0.2
IBM I Training Assignment V0.2
IBM I Training Assignment V0.2
Questions
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Questions
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
Ans:
9. What can be done if we want to compile the file without losing the data?
Ans:
Questions
Ans:
Ans:
Ans:
4. If you are in edit mode of source then what can be used for system command
prompt? (one word)
Ans:
Ans:
Ans:
Ans:
Questions
Ans.
2. What is the factor 1 argument of opcode setll, if file pointer should start from
lowest key value?
Ans.
3. Which opcode is used to read the record from a file, at which file pointer is set?
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 of file,
with the factor 1 argument of that opcode?
Ans.
8. Which opcode is used to write a record to the file and what should be in the
factor 2 argument of that opcode?
Ans.
Ans.
Ans.
Questions
1. Write a rpgle program to handle divide by zero error. (By using monitor with
on-error or by *PSSR subroutine)?
Ans:
2. Write a rpgle program to validate a date field. (Use test(de) & %error, i.e.:
cannot put 32-01-2021)
Ans:
Ans:
4. What is the opcode extender to handle error for without setting pointer in pf and
trying to read or update the PF?
Ans:
Ans:
Questions
Ans:
a) Div
b) Sqrt
Ans:
Ans:
4. Which opcode is used to search a string and return the leftmost position?
Ans:
5. Which opcode is used to search a string and return the rightmost position?
Ans:
6. Name the opcode which represents the beginning and ending of a Subroutine.
Ans:
Questions
1. We have a String:
Ans.
Ans.
*Addition.
*Subtraction.
* Multiplication.
Ans.
Ans.
Ans.
Ans.
Questions
Output: 9 * 1 = 9, 9 * 2 = 18, . . . . . . . . . 9 * 10 = 90
Output: 1, 2, 3 . . . . . . . . 20
Output: 1, 2, 5, 7 . . . . . .
Output: 2, 4, 6 . . . . . . .
Output: 1, 3, 5 . . . . . .
**
***
****
* ***
*****
****
***
**
Questions
Ans.
Ans.
3. Create a program to update data into file using Display screen? (Hint: Use Chain
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:
vir_g : ___a_
vir__ : ___ag
v_r__ : _i_ag
v____ : _irag
Questions
1. Create a physical file and logical file by using the proper coding standards for
file and field name. (Write readable and efficient code)
Ans.
2. Write a basic program of file handling and try to use comments and proper
documentation with proper coding format.
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.
6. What should be the Colour of comments and which Colour we should avoid?
Ans.
Ans.
8. What should we use instead of deep nested if loop to make good practicing?
Ans
Questions
Ans.
Ans.
Ans.
Ans.
Ans.
6. How we can call another program from one program and pass parameters
(describe by example)?
Ans
Questions
Ans.
Ans.
Ans.
Ans.
Q5. Create a subfile and its program, to display all records of physical file.?
Ans.
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.
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.
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 for that.
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 in it?
Ans:
5. Delete the records from physical file using sql prepare and execute statements.
Ans:
Ans:
7. Create one program to fetch the records from physical file using the concepts of
cursors.
Ans:
Ans:
Ans:
Employee Registration
ID: 101
Name: _________
Age: __
Date of joining: __/__/__ (MM/DD/YY)
4. Create a simple calculator performing basic operations (Add Subtract Multiply Divide).
Calculator
Num1: _________
Num2: _________
Operation: __ (+ - * /)
Result: _________________
F3 = Exit
5. Create a Join logical file on two or more PF and display their data into single subfile?