AS400 Interview Questions- Part2

AS400 Interview Questions- Part2

1.  Why should a programmer use the OVRDBF command?
To override default values set for the physical file; i.e., to utilize a specific member in a physical file.

2.Explain about RTNCSRLOC?
            It will give field name where the cursor is living in a sub-file or a display-file.

3. How would you print only last 10 pages of a report?
CHGSPLA command is used. In that the PAGE RANGE parameter will control the no. Pages to print.

4. What is a message file?

            It is used to store all the messages to be sent to programs. It has two parts.
1.      Message ID –7 Character
2.      Message Description

5. What is an Object?

Anything, which occupies memory, is known as Object. When you execute a program, object will be created. The object has a set of attributes, which includes name, type, size, creation data, and a short description of the object. WRKOBJPDM is used to display all object in a library. With in the library the object name and its type is Unique

6.  What is the purpose of the CHKOBJ command?
To test for the existence of and object and to check for object authorization for the user.

7. CRTDUPOBJ – Explain.

            Create Duplicate Object. To copy an object we use this command.

8.  What is the purpose of the DSPLIBL command?
Displays a list of all libraries whose objects are available to the interactive job.

9. What is a Library? Explain its types.
Library is an object of type *LIB that is used to group related objects. Thus library is a directory to a group of object.
Library is an open-ended directory.
Library can never become ‘full’ as it has no finite size.
Library reside only in system library QSYS.
The order of library is
System library – 15 nos. e.g. QSYS
Product library – 1
User library – 25 nos. QTEMP, QGPL are user libraries.
Current library – 1

ADDLIBLE, RMVLIBLE, CHGCURLIB, DSPLIBL, EDTLIBL is used to add the content to current library, remove the content to current library, change current library, display all library and editing the library respectively.

10. What are user library?
            QTEMP, QGPL and MYLIB

11. What are library list and how many libraries can be in library list?
The library list is a list of library, which is to be searched for existence of a file. It contains four parts, System part, Product part, User part and Current library.
We can place as many as 40 libraries in a library list. In that 15 as system lib and 25 as user lib.
The related commands are EDTLIBL, ADDLIBLE, RMVLIBLE, and DSPLIBL

12. What is current library?
            The command to change a library into current library is CHGCURLIB

The library, which is always in the top of library list and it, is the first library searched when a job is executed.

13. What is the purpose of changing current library?
            If you compile a member then we need to change the current library.

14. What two CL commands are usually used to debug a program?
STRDBG and ADDBKP - Start Dedub abd Add Breakpoint.

15.  What CL command is used to debug a program on-line?
STRISDB - Start Interactive Debugger

16. How you execute CL command in RPG?
            By using QCMDEXC command we can execute CL command in RPG.

17. What does UPDPROD *NO and INVOKE PGM *YES mean?
UPDPROD *NO (default) wont update the files used in the program and *YES will do.

INVOKE PGM *YES (default) will execute the CALLING program simultaneously and *NO will execute only when the CALL statement is executed.

18.  What is QCMDEXC?
A program that can be called from an RPG program to execute most
CL commands.

19. Which OS/400 command does not execute in command line?
RTVDTAARA & RTVSYSVAL .For this you have to declare one to variable

20. How to send message to the screen by SNDPGMMSG?
By passing the Message file name, Message ID and Message Data, we can send a message to the screen.

21. What is the difference between CALL and Transfer Control?
CALL                         will transfer the control according with the CALL STACK
TFRCTL         [Transfer Control] will remove the CALL STACK and transfer the control to the calling program. The CALL is used to interface between two different types of programs, whereas TFRCTL is used to call CL programs only.

22. What are the different Queues available in OS/400?
They are
·         Job Queue
·         Message Queue
·         Output Queue
·         Data Queue
Job Queue:                 It contains the list of batch job waiting to be compiled.

Message Queue:         It contains various messages to be sent to programs, procedures or user.

Output Queue:           It contains all the spooled files waiting to print.

Data Queue:               It is a temporary storage. We can able to store and retrieve data. But either once the data retrieved or the waiting time closed the data will be lost.
Sending a message to a data queue by QSNDDTAQ, QRCVDTAQ and                           CLRDTAQ commands.

23. QSNDDTAQ, QRCVDTAQ Explain.
           QSNDDTAQ is a command, that is used to send a message to other / same program.
QRCVDTAQ is a command, that is used to receive a message from other / same program.

24. What are the mandatory parameters for declaring a Data Q?
These are DataQ Name, Library, Data, Length of the data and Wait. The Wait is appearing only on the QRCVDTAQ
  
25. Explain RUNSQLSTM statement.
It is command, which is used to store and execute set of sql statements. These statements may be insert or update or delete. Select statements can’t be used. These to be included with the source type as sql. Then using strsqlstm to execute the program.

RUNSQLSTM SRCFILE (XXLIB/PF01) SRCMBR (SQL01)
COMMIT (*NONE)

26. How to create RPG, RPGILE, CL, CLLE, PF, LF, DSPF and RLU?
CRTRPGPGM            : used to create RPG
CRTCLPGM              : used to create CL program
CRTBNDRPG            : used to create RPGILE program. (CRTBNDRPG = 
                                    CRTRPGMOD + CRTPGM)
CRTBNDCL               : used to create CLLE program
CRTPF                        : used to create a PF
CRTLF                        : used to create a LF
CRTDSPF                   : used to create a Display File

27.  What is PWRDWNSYS?
      The command to power down the AS/400.

28.  What is the purpose of the EDTOBJAUT command?
      To permit or exclude user access to specific objects.

29. What are the tools available in AS/400?
·         Program Development Manager (PDM)
·         Source Entry Utility (SEU)
·         Data File Utility (DFU)
·         Screen Design Aid (SDA)
·         Report Layout Utility (RLU)
The commands to use these are
STRPDM, WRKMBRPDM, WRKOBJPDM, WRKLIBPDM, STRSEU, STRDFU, STRSDA and STRRLU

30. Explain the STRSEU command.
To create a new program or put the last used program in edit Mode

31. What is QTEMP?
A unique temporary library associated with each job. The object in this library will be deleted when the workstation signoff.

32. What is PDM?
PDM (Program Development Manager) is a tool to simplify software development and maintenance and is used to work with library, objects and file members and also with user defined commands.

WRKLIBPDM
Work With Library PDM. To work with the objects inside the library, like copy delete the objects.
The default parameter is ‘lib         *prv’

WRKOBFPDM
Work With Object PDM. To work with the objects resides in a source physical file such as rename, copy, delete, edit etc.

WRMBRPDM
Work With Member PDM. To work with the file members of a source physical file such as rename, copy, delete, edit etc.
            Related commands are
           
WRKLIB : To work with the library object in the system library or if we specify the lib name in the parameter then we can work with the objects in that specified library.
The default parameter is ‘lib           *libl’

            WRKOBJ : To work with the specified object. The parameter to pass is ‘object name’.
The difference between WRKOBJPDM and WRKOBJ is the ‘obj attribute’ will not be in WRKOBJ
Obj name                     ----------
                                    Lib name                     *libl      
                                    Obj type                      *All]
COMMIT (*NONE)

33. Explain WRKOBJPDM and DSPOBJD
DSPOBJD if we know library name and object name and we want to know the source physical file where it is residing then dspobjd with option as services instead of basic will give the source physical file name.

WRKOBJPDM is used to list all in particular library. If we want to list all rpgle programs, then put type as rpgle. It is just like a DIR command on DOS.

34. What is job and explain its type?
            Every piece of work runs on the system is called job.
            The types are
Interactive job
The job runs on the system after one sign-on the workstation is called interactive job and it will end when sign-off.
Batch job       
It is the predefined sequence of work submitted to the Job Queue. It wont be interrupted by the user. Thro’ SBMJOB command we can submit the Batch job to Job-Queue.

35. How would you see the Batch job?
            Thro’ the command WRKSBMJOB.

36. What are the attributes for the job?
            Job Number, Job Name and User Name.

37. What is the Error severity?
            Error Severity determines the level of severity required to terminate the job.

38. What is the error indicator?
In C spec, we can declare 3-types of indicators. High, Low and Equal. Here Low indicator acts as error indicator.
                                                     HiLoEq
C              READ     REC1           252627
Here 25 is EOF reached, 26 is No record found and 27 is Record found

39. What are the authorities in AS/400?
                                i.            *ALL              -has all authorities
                              ii.            *CHANGE     -has object operation, read, add, delete and update
                            iii.            *USE              -has object operation and read
                            iv.            *EXCLUDE   -none
                              v.            *READ (Read)
                            vi.            *ADD (Add)
                          vii.            *UPD (Update)
                        viii.            *DLT (Delete)

40. How would you change the authority of an object?
            GRTOBJAUT command will change.

41. What are different database functions?
§  CTROBJ
§  DLTOBJ
§  CHGOBJ
§  RTVOBJ

§  CRTDUPOBJ

No comments