AS400 Interview Questions and Answers Part14

This article provides AS400 interview questions and answers for IBM i developer.
AS400 Interview Questions and Answers Part14, as400 interview questions, ibmi interview question, rpg interview question, sql interview questions, cl interview questions, opnqryf, ovrdbf, commit in rpg, leave opcode, infds, open data path, runsqlstm,OVRDBF SHARE(*YES),
AS400 Interview Questions and Answers Part14

Q1: What is the main use of OPNQRYF? Why should we use OVRDBF SHARE(*YES)?

Answer 1:

OPNQRYF will select those records which are going to be processed by the program, By using the Open Query File (OPNQRYF) command, you can open a file to a set of database records that satisfies a database query request. The OPNQRYF command allows you to perform many data processing functions on database files. it acts as a filter between the processing program and the database records.

We use OVRDBF SHARE(*YES) to use the open data path (ODP) created by the Open Query File (OPNQRYF) command.

Q2: How to insert data in PF by using the CL program?

Answer 2:

In CL, we can use the RUNSQLSTM command to execute the SQL Insert statement to insert data in PF.

Q3: define the purpose of the LEAVE operation?

Answer 3:

LEAVE operation will be used inside loops. Once the LEAVE opcode gets executed it will transfer the control after the ENDDO and it will execute the next line just after the ENDDO.

Q4: How to get the number of records in a file in RPG without the CL command?

Answer 4:

  • Using INFDS(file information data structure)
  •  D NUM_RCDS 156 159I O*Num of records

    Q5: How do you use Commitment control in the RPG program?

    Answer 5:

    COMMIT command is used to commit the changes we perform in a database. For using commitment control we need to journal the file.

    Post a Comment

    © AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain