AS/400 Interview Questions Answers: Part 1

12/14/2009 1 Comment

Mainframe AS400 Interview Questions and Answers.

AS400 Interview FAQs and Questions.

Define what a data area is along with a brief example of what it may be used for?
Answer :
Data area is a storage area to store limited information.
Example: a new and unique customer number is generated whenever a new customer is added to customer master file. Data area keeps track of last record added and add 1 to it. Through program we can access new customer number.

Define what a data queue is along with a brief example of what it may be used for?
Answer :
Data queues provides communication between programs by calling API's QSNDDTAQ and QRCVDTAQ along with parameters like data queue name, library in which data queue exists, variable to store the number of characters to be sent, variable to store the information to be sent. We can send the same data queue to the many programs.

What is the purpose of the following?
I 'CLOSED' C STAT01
I 'OPEN' C STAT02
Answer :
It is a type of initializing the variables in I-spec. and these are further used in C-spec.

What is the difference between UDATE and the system date?
Answer :
UDATE supports two-digit year. The format is *MDY (MMDDYY).
*DATE (system date) supports four digit year. The format is *MDYY (MMDDYYYY).

List some of the commonly used commands for debugging
Answer :
STRDBG(for batch jobs), STRISDB.

Define the RCVF command?
Answer :
RCVF command used to receive the records either from the data base file or device file.

Define the purpose of the %SST function?
Answer :
To extract the information from the specified string.

Define the purpose of the *CAT function?
Answer :
To concatenate the two strings into a one string.

Define the purpose of the *BCAT function?
Answer :
To concatenate the two strings by placing a single blank in a resultant.

Describe the difference between the DOWxx and DOUxx operations?
Answer :
DOWxx : If the condition becomes true, then only the group of instructions allowed executing.
DOUxx : Irrespective of condition, it will execute at least one time.

Define the purpose of the LEAVE operation?
Answer :
If you specify LEAVE, the control transfers to the statement below the ENDDO.

Define the purpose of the ITER operation?
Answer :
If you specify the ITER, the groups of statements are allowed to execute repeatedly.

List the steps/commands necessary to accomplish the following:
a. Copy data from the file ORDHDR into file ORDHIST
b. The file ORDHIST may or may not exist
c. If the file ORDHDR does exist, it may or may not contain data
d. The file ORDHIST may or may not contain data, if the file does contain data the old data should be erased
Answer :
Commands are as follows
a. CPYF FILE(ORDHDR) TOFILE(ORDHIST)
b. CPYF FILE (ORDHDR) TOFILE (ORDHIST) CRTFILE (*YES)
c. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *ADD
d. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *REPLACE

What is the purpose of the following?
FORDHDR1 IF E K DISK
ORDHDRF KRENAMEORDHDRF1
Answer :
In order to rename the record format of a data base file in a program,
we can use the above steps. Purpose of renaming is: If the record format name is similar in two files and if both are used in a same program, the program will not compile. Hence we have to rename either of the file.

What is the purpose of the following
Answer :
C/COPY QRPGSRC,ORDERR
During the compilation the source code of ORDERR copy book is copied into the existing program. Where as /COPY is compiler directive statement.

What is the purpose of the following
Answer :
FORDHDR1 CF E WORKSTN
$2SFN SFILE FMT2
The above line indicates that, $2SFN is a relative record number and FMT2 is name of the subfile record format.

How can you check for a records existence without causing and I/O (CHAIN/READ)?
Answer : With the help of File Information Data Structure, we can check existence of records in a physical file. The code is described below: In File description continuation line (IPFK), KINFDS RCDS IRCDS DS I *RECORD #RCDS with the above code we can check the existence of records in a file without causing I/O operation.
Related Posts


1 comment :

 

Aired | The content is copyrighted and may not be reproduced on other websites. | Copyright © 2009-2016 | All Rights Reserved 2016

Contact Us | About Us | Privacy Policy and Disclaimer