Vous êtes sur la page 1sur 2

http://www.scribd.com/doc/12305285/IBM-AS400-Interview-Question================= AS\400 Interview Questions1. Define a shared access path?

To share the open data path by various programs in a same job.2. What is the difference between array a nd a multiple occurrence data structure?The values stored in array don t vary. In th e other hand, we can store theDifferent values in same variables at various stag es.3. What is *INZSR used for?It is special type of RPG/400 subroutine, which is executed automaticallyat beginning of the program. It is a good place to code i nitializes the variables.4. How can you execute a command from within an RPG pro gram without calling a CLPprogram?By calling QCMDEXC application program interfa ce we can execute a CL command within an RPG program.5. What is the purpose of t he "N" in the following calculation specification?C KEY CHAIN FILE N 99If you sp ecify 'N' in 53rd position, the record will not be loc ed if you try toread the loc ed record. It is a way of avoiding the record loc .6. Which of the following operations does NOT zero the field FLDA defined as 4,0?C MOVE *ZEROS FLDAC Z-AD D *ZEROS FLDAC Z-ADD 0 FLDAC MOVE *ALL'0' FLDAC SUB FLDA FLDAC MOVE '0000' FLDAC CLEAR FLDAC MOVE *BLANKS FLDAThe last instruction does NOT zero the field FLDA. 7. How can you chec for a records existence without causing and I/O (CHAIN/READ )?With the help of File Information Data Structure, we can chec existence ofrec ords in a physical file. The code is described below:In File description continu ation line (IPFK),KINFDS RCDSIRCDS DSI *RECORD #RCDSwith the above code we can c hec the existence of records in a file withoutcausing I/O operation.8. Define w hat a data area is along with a brief example of what it may be usedfor? Data area is a storage area to store limited information.Example: a new and uniq ue customer number is generated whenever a new customer isadded to customer mast er file. Data area eeps trac of last record added and add1 to it. Through prog ram we can access new customer number.9. Define what a data queue is along with a brief example of what it may be usedfor?Data queues provides communication bet ween programs by calling API's QSNDDTAQ andQRCVDTAQ along with parameters li e d ata queue name, library in which data queueexists, variable to store the number of characters to be sent, variable to storethe information to be sent. We can se nd the same data queue to the many programs.10. What is the purpose of the follo wing?I 'CLOSED' C STAT01I 'OPEN' C STAT02It is a type of initializing the variab les in I-spec. and these are further usedin C-spec.11. What is the difference be tween UDATE and the system date?UDATE supports two-digit year. The format is *MD Y (MMDDYY).*DATE (system date) supports four digit year. The format is *MDYY (MM DDYYYY).12. List some of the commonly used commands for debuggingSTRDBG(for batc h jobs), STRISDB.13. Define the RCVF command?RCVF command used to receive the re cords either from the data base file or devicefile.14. Define the purpose of the %SST function?To extract the information from the specified string.15. Define t he purpose of the *CAT function?To concatenate the two strings into a one string .16. Define the purpose of the *BCAT function?To concatenate the two strings by placing a single blan in a resultant.17. Describe the difference between the DO Wxx and DOUxx operations?DOWxx : If the condition becomes true, then only the gr oup of instructions allowedexecuting.DOUxx : Irrespective of condition, it will execute at least one time.18. Define the purpose of the LEAVE operation?If you s pecify LEAVE, the control transfers to the statement below the ENDDO.19. Define the purpose of the ITER operation?If you specify the ITER, the groups of stateme nts are allowed to executerepeatedly.20. List the steps/commands necessary to ac complish the following: a. Copy data from the file ORDHDR into file ORDHISTb. The file ORDHIST may or ma y not existc. If the file ORDHDR does exist, it may or may not contain datad. Th e file ORDHIST may or may not contain data, if the file does contain data theold data should be erasedCommands: a. CPYF FILE(ORDHDR) TOFILE(ORDHIST)b. CPYF FILE (ORDHDR) TOFILE (ORDHIST) CRTFILE (*YES)c. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *ADDd. CPYF FILE (ORDHDR) TOFILE (ORDHIST) *REPLACE21. What is the purpose of th e following?FORDHDR1 IF E K DISKORDHDRF KRENAMEORDHDRF1In order to rename the re cord format of a data base file in a program,we can use the above steps. Purpose of renaming is: If the record format name issimilar in two files and if both ar e used in a same program, the program will notcompile. Hence we have to rename e

ither of the file.22. What is the purpose of the followingC/COPY QRPGSRC,ORDERRD uring the compilation the source code of ORDERR copy boo is copied into theexis ting program. Where as /COPY is compiler directive statement.23. What is the pur pose of the followingFORDHDR1 CF E WORKSTN$2SFN SFILE FMT2The above line indicat es that, $2SFN is a relative record number and FMT2 is nameof the subfile record format.24. What is the purpose of the followingI UDSI 1 60ORDER#I 7 90LINE#The purpose is to define the variables in I-Spec and these are further used in C-spe c. Where as U indicates data area data structure? The above code is used toupdate the data area value through the program. The letter "U" indicates that thedefined da ta structure is a data area data structure.25. What is the purpose of the follow ing?A CSRLOC (F1ROW F1COL)Using this record level eyword, you can specify curso r location on an outputoperation to the record format you are defining. The prog ram sends output aftersetting the cursor location.26. What is the difference bet ween SFLCLR and SFLINZ?SFLCLR : It clears the subfile.SFLINZ : First it clears t he subfile and initiliazing the numeric variables with zeros and alphanumeric variables with characters.27. Define the purpose/use for SFLRNA?Using this, we can ma e specified subfile record format inactive.28. Defi ne what the operation will do, the purpose of the result field and thepurpose of *IN66?HI LO EQC CALL 'CVTDAT' DTPRM 66The above statement causes, call the prog ram and pass the parameter.29. Define each of the following operation codesa. RE AD To read the records sequentially.b. READE To read the equal ey recordsc. REA DP To read the previous recordsd. READC To read the records from the wor station file (Subfile).e. REDEP To read the equal ey previous records.30. Define the p urpose of the following code (If you now, how would this bewritten in RPG ILE)H I LO EQC *IN66 DOUEQ *OFFC KEY1 CHAIN FILEA 90 66C 66 CALL PGM1 PRMC ENDDOWhenev er the indicator *IN66 becomes *OFF, the control transfers after ENDDOstatement. Otherwise, it reads the records from the data base file based onindicator speci fied on HI position. If the specified indicator on LO positionbecomes *OFF, then only CALL statement will execute.31. How do you set the eywords SFLSIZ and SFL PAG if you want the subfile todynamically expand?SFLSIZ > SFLPAG.32. When would you use or not use this approach?It is the most desirable method in building a r eal time applications. We can useat all the times.33. How can you detect and han dle a record loc situation?If you try to read the loc ed record, we can get sys tem defined message i. e. ,the program will ended abnormally. With the help of F ile Information DataStructure we can handle record loc situation. Generally it will happen, when thesame file of type " U" used in different programs.34. How c an you detect overflow for a print program that prints multiple lines percycle?Y ou specify the indicators OA through OG and OV in 33 - 34 columns in a printerfi le. This indicator automatically set on whenever overflow occurs on a type ofpag e.

Vous aimerez peut-être aussi