You are on page 1of 5

AS/400 FAQs

1) How to get the Job log of a Batch program submitted using SBMJOB ?
Ans: Set Message logging paramters (Level/Severity/Text) to log the messages. Give Text=*MSG
to log all the messages. To find out the Job start and end time you can use DSPJOB command
and locate the job with the Job number / User.
2) How to add and remove constraint to/from a Physical file in AS/400 ?
Ans: ADDPFCST & RMVPFCST
3) Logical file Maintenance - *REBUILD, *IMMED... - What does this mean ?
Ans: Check all the Parameters of CHGLF(Change Logical file command)
Logical file maintenance parameter specifies the type of access path maintenance used for all
members of the logical file. This parameter is valid only for keyed files or join files.
Note: For a join logical file, this parameter applies to all join secondary access paths, even if the
join file is not a keyed file.
*SAME
The files access path maintenance does not change.
*IMMED
The access path is continuously (immediately) maintained for each logical file member. The
access path is changed each time a record is changed, added to, or deleted from the member.
The records are changed through a logical file that uses the physical file member containing the
data regardless of whether the logical file is opened or closed. *IMMED is specified for all files
requiring unique keys to ensure uniqueness in all inserts and update operations.
*REBLD
The access path is rebuilt when a file member is opened. The access path is continuously
maintained until the member is closed; then access path maintenance is ended. *REBLD is not
valid for access paths that contain unique key values.
*DLY
The maintenance of the access path is delayed until the member is opened for use. Then the
access path is changed only for records that are added, deleted, or changed since the file was
last closed. *DLY is not valid for access paths that require unique key values.
4) Difference between creating a report using Printer file and WRKQRY(Query Report) ?
5) Expalin Journalling and explain how to Journal a Logical file ?
6) F19(Shift left) & F20(Shift Right) using Subfiles - Each field has a length of 120 characters
which exceeds the screen size of 80 columns ? - Program should show a screen exactly same as
that of the Screen showned in the RUNQRY ?
Ans: For eg., say there are 5 fields with 100 characters each in a D/b file. Define two fields in the
Subfile record format, one i/o capable field with 80 char(24x80 display) and one hidden field with
500 char length(total d/b fields x length of each field = 5 x 100). Read from D/b file and
concatenate all the fields and load in to the hidden field(with 500 char length) while building the
subfile. Have two work fields, say SP(starting pos) and Len(Length=80 char) and
increase/decrease SP based on F19/F20 and accordingly adjust the Len variable and display the
same in the screen.
7) How to find a record lock in the RPG Program ?
Ans: 1) Thru INFDS(find out the field name).

2) In CHAIN/READEQ, the LO Indicator will be set on if record lock exists.


8) A large Database with millions of records needs to be accessed by more than 100 users
simultaneously - what is the solution you give to avoid record locking situation ?
Ans: Handle it in your RPG program. Find out if the record is locked. If yes, issue an error
message that the record is locked.
(some other solution needs to be there)
9) What are the three different types of Subfiles and explain their concept ?
Ans: 1. Load-All, 2. Expanding, 3. Single Page loading
10) How many active subfiles can be there in an RPG Program?
Ans: 24 Active Subfiles
11) Differnce between creating Program(CRTPGM) and Bound RPG(CRTBNDRPG).
Ans: The CRTPGM is used for creating Program objects written in OPM RPG. The CRTBNDRPG
command creates a temporary module in the QTEMP library and creates the Program object CRTBNDRPG command is used for directly creating Program objects for ILE RPG programs.
12) Instances when Data queue used and how?
13) Difference between ILE & OPM.
Ans:
(i) In ILE programs written in other languages can called by the RPG programs.
(ii) Memory can be used effectively with the help of ACTGRP - It also facilitates in sharing
of database files between different
programs running inside the same activation group.
14) Details - Activation group usage .
15)How objects can be authenticated only to certain user profiles.
Ans: GRTOBJAUT
16)Version control - Tools used
17)Software Configuration management for the projects done - explain.
18)How to get source of compiled program object.
Ans: In case of CL program, RTVCLSRC will do the job. In case of RPG program, you have Cut,
copy and paste the code from Spool files, if available any.
19) Is it possible to store a Photograph in AS/400 and take a print-out of it ?
Ans: As DB2 UDB supports data types like GRAPHICS, LOBs(Large Objects), one can get the
gif or jpg files in to the AS/400 and store into the file and the record could be retrieved to take
print-out. (This answer may also be wrong !!!)
20) How to access Nth record in a RPG program using RRN ?
Ans: You can define RecNo(@RRN) in the F Spec and move the RRN to @RRN and chain the
file with @RRN - This is in ILE RPG IV - (Find out how to do in OPM RPG).
21) Explain Message subfile.
22) What are the different type of special data structures and explain about the usage of each of
its subfields
Ans:
(i) UDS (Data area data structure)
(ii) INFDS(File Information data structure)
(iii) SDS(Porgram status data structure)
(iv) INDDS(Indicator Data Structure)

23) How do you rename all the fields of a file inside a program in RPG ?
Ans: In the I spec declare the Record format name, followed by the fieldname(s) and their alias
name, as shown below:ICBCTLCR
I
CBTCDC
C#TCDC
I
CBCTBC
C#CTBC
etc.,
24) Different ways of describing Access Path ?
Ans:
1) Keyed sequence access path (by defining keys in the LF)
2) Encoded vector access path (by using SQL CREATE INDEX)
3) Arrival sequence access path (no keys specified for the file)
4) Previously defined keyed seq access path (using REFACCPTH)
25) Providing for Help facilities in Display files (S/files) ?
26) Is it possible to update a files using a Join logical file in a Program?
Ans: No. Only in SQL/400 this kind of operation can be performed.
26) What is the difference between SETON *LR and SETON *RT ?
27) An RPG program calls a CL program. The CL program OVRDBFs, say FILEA, and this
overriden file should be used in the RPG program. Since CL prg is is below the RPG prg in the
call Stack, what parameter should be used in OVRDBF command in the CL program, so that the
RPG porgam is able to use the overriden file ?
Ans: OVRDBF with OPNSCOPE(*JOB)
28) What is the difference between WRKSYSSTS and WRKACTJOB ?
29) What is the protocol that is used by AS/400 to communicate with other AS/400 servers ?
Ans: SNA (may be wrong !!!).. Check out if it is SNA or TCP/IP
30) How do you CHAIN or READ(x) without locking record ?
Ans: CHAIN or READ(x) with N (No record locking)
31) How do you find out the number of parameters passed to a RPG Program ?
Ans: The *PARMS field in the Program Status Data Structure (PSDS) contains the total number
of parameters passed to the called program by the calling program.
32) How do you use a flat file within an RPG program ?
Ans: For a flat file, the name of the file, the name of the record format in the file and the name of
the single field in the file will all be same as the name of the file as specified while creating the file
using CRTPF command. Hence, the record format name should be renamed(in F Spec) and the
field name should also be renamed(in I Spec - use prompt JX) before processing the file in the
RPG program.
33) Using Interactive SQL, how do you run any query that shows the records of member of a PF
?
34) How do you find out When a job was started and when it was completed ?
Ans: (i) To view all jobs(or also a particular job if u know Job numbers), use DSPLOG
(ii) U can also use DSPJOB to view the details, if u know the Job number/User/Job name
parameters.

35) How to find out if a Job is running in interactive or in batch mode in (i) CL Program and (ii)
RPG Program ?
Ans: (i) CL Program = RTVJOBA, (ii) RPG Program = in Program Status data structure (this may
be wrong !!!)
36) What is the difference between System date and Job date ?
37) If you submit a Job at 11:55 p.m and the job runs till next day morning 2 a.m, what will be the
Job date and System date when the Job was started and when the job ended ?
38) What is System ASP(Auxiliary Storage Pool) ? Explain its usages.
39) Does IN & OUT opcodes locks data area ?
Ans: IN and OUT operations allows to control the locking and unlocking of a data area. When a
data area is locked, it can be read but cannot be updated by other programs. The following lock
states are used:
(i) For an IN operation with *LOCK specified, an exclusive allow read lock state is placed
on the data area.
(ii) For an OUT or UNLCK operation, the exclusive allow read lock state is released.
Note: During the actual transfer of data into or out of a data area, there is a System Internal lock
on the data area. If several users are contending for the same data area, a user may get an error
message RPG0431 indicating that the data area is not available.
40) Say, X = A + B = How do you find out X is capable of containing the value that results from
the sum of A and B ?
Ans: %SIZE
41) How to convert a spool file into a Text file ?
Ans: If it is Client Access Express for Windows, you can right click in the desktop and transfer the
spool file to the PC as text file.
42) How do you find out the total number of members of a PF ?
Ans: DSPFD (Display File Description) command shows all the file related attributes like no. of
members, no. of triggers, no. of constraints, maximum members allowed for this PF, access path
maintenance/recovery, file wait time, rec wait time etc., If you want to retrieve the values,
specify a filename in the OUTFILE parameter of DSPFD and get the value from the out file
from within the pgm.
43) How will you find out the total number of CPUs and CPU utilities ?
Ans: WRKSYSACT (Work with System Activities) - also you can monitor and work with jobs.
44) Is Procedure Interface definition a must ?
Ans: If the Procedure does not have any parameters and if it does not returns any value the PI
definition can be omitted.
45) How will you find out the size of the objects ?
Ans: Use WRKLIB(Work with library) command and take 5=Display option against the library
name - now you will be able to see the program name, type, attribute, size and description of the
object.
Important References :1) Alphabetical listing of all CL commands http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm

2) DDS Keywords for display files(including Subfile keywords) http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm

You might also like