As/400 Interview Question
As/400 Interview Question
As/400 Interview Question
com/doc/12305285/IBM-AS400-Interview-Question
=================
2. What is the difference between array and a multiple occurrence data structure?
The values stored in array don’t vary. In the other hand, we can store the
Different values in same variables at various stages.
4. How can you execute a command from within an RPG program without calling a CLP
program?
By calling QCMDEXC application program interface we can execute a CL command with
in an RPG program.
If you specify 'N' in 53rd position, the record will not be locked if you try to
read the locked record. It is a way of avoiding the record lock.
6. Which of the following operations does NOT zero the field FLDA defined as 4,0?
7. How can you check for a records existence without causing and I/O (CHAIN/READ)?
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.
8. Define what a data area is along with a brief example of what it may be used
for?
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.
9. Define what a data queue is along with a brief example of what it may be used
for?
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.
I 'CLOSED' C STAT01
I 'OPEN' C STAT02
It is a type of initializing the variables in I-spec. and these are further used
in C-spec.
11. What is the difference between UDATE and the system date?
RCVF command used to receive the records either from the data base file or device
file.
17. Describe the difference between the DOWxx and DOUxx operations?
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.
If you specify LEAVE, the control transfers to the statement below the ENDDO.
If you specify the ITER, the groups of statements are allowed to execute
repeatedly.
FORDHDR1 IF E K DISK
ORDHDRF KRENAMEORDHDRF1
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.
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.
I UDS
I 1 60ORDER#
I 7 90LINE#
The purpose is to define the variables in I-Spec and these are further used in C-
spec. Where as ‘U’ indicates data area data structure? The above code is used to
update the data area value through the program. The letter "U" indicates that the
defined data structure is a data area data structure.
Using this record level keyword, you can specify cursor location on an output
operation to the record format you are defining. The program sends output after
setting the cursor location.
26. What is the difference between SFLCLR and SFLINZ?
SFLCLR : It clears the subfile.
SFLINZ : First it clears the subfile and initiliazing the numeric variables with
zeros and alphanumeric variables with characters.
28. Define what the operation will do, the purpose of the result field and the
purpose of *IN66?
HI LO EQ
C CALL 'CVTDAT' DTPRM 66
The above statement causes, call the program and pass the parameter.
30. Define the purpose of the following code (If you know, how would this be
written in RPG ILE)
HI LO EQ
C *IN66 DOUEQ *OFF
C KEY1 CHAIN FILEA 90 66
C 66 CALL PGM1 PRM
C ENDDO
Whenever the indicator *IN66 becomes *OFF, the control transfers after ENDDO
statement. Otherwise, it reads the records from the data base file based on
indicator specified on HI position. If the specified indicator on LO position
becomes *OFF, then only CALL statement will execute.
31. How do you set the keywords SFLSIZ and SFLPAG if you want the subfile to
dynamically expand?
It is the most desirable method in building a real time applications. We can use
at all the times.
33. How can you detect and handle a record lock situation?
If you try to read the locked record, we can get system defined message i. e. ,
the program will ended abnormally. With the help of File Information Data
Structure we can handle record lock situation. Generally it will happen, when the
same file of type " U" used in different programs.
34. How can you detect overflow for a print program that prints multiple lines per
cycle?
With the help of OPNQRYF Clp command, we can select the records from the data base
file. The process involves following steps:
36. How would you join 3 separate fields, a first name, middle initial and last
name together as 1 field with proper spacing? You can describe in either RPG
and/or RPG ILE (Integrated Language Environment)
37. When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses
the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the
*INZSR executed?
If you specify RETRN in called program, the *INZSR will not execute again.
38. Show 2 ways to convert a date from YYMMDD to MMDDYY (MULT operation not
acceptable)
PGM
DCL VAR(&VAR1) LENGTH(6) TYPE(*CHAR) VALUE('YYMMDD')
DCL VAR(&RCVD) LENGTH(6) TYPE(*CHAR)
DCL VAR(&VAR2) LENGTH(4) TYPE(*CHAR)
DCL VAR(&VAR3) LENGTH(2) TYPE(*CHAR)
CHGVAR VAR(&VAR2) VALUE(%SST(&VAR1 3 4))
CHGVAR VAR(&VAR3) VALUE(%SST(&VAR1 1 2))
CHGVAR VAR(&RCVD) VALUE(&VAR2 *CAT &VAR3)
SNDMSG MSG(&RCVD) TOUSR(*USRPRF)
ENDPGM
a. Cost = $110. 00
b. Tax = 20%
c. MarkUp= 05%
d. Sale = 10%
If the factor 1 value matches with factor2 value, the indicator specified in EQ
comes *ON.
The SETLL operation positions a file at the next record with a key or relative
record number that is greater than or equal to key or relative record number
specified in factor1.
Specifies whether the level identifiers of the record formats in the physical file
are checked when the file is opened by the program.
59. What is the difference between access path and Dynamic select?
Dynamic select occurs whenever the program reads file. But access path occurs
before the file is read (but not necessarily). Because access path maintenance
performed on the file.
63. What is the difference between regular logical file and join logical file?
Regular logical file contains more than one record format.
Record format name in regular logical file should be same based on the physical
file.
Join logical file contains only one record format.
Record format name in join logical file should be different.
Through logical file we can made changes in physical file.
Through join logical file we can't made changes in physical file.
66. What is the necessary keyword used in a physical file to refer field
definitions from the field reference file?
REF which is a file level keyword is necessary to define at file level in a
physical file. The syntax is as follows: REF(library name/name of the field
reference file)
72. What are the different types of access paths maintained on the file?
Immediate: All the access paths (open and close) associated with a file will be
updated whenever changes made to a file.
Rebuild- only open access paths will update whenever changes made to the file.
Rebuild takes place whenever remaining access paths will be open.
Delay : Rebuild will not takes place.
74. What is the difference between production library and test library ?
In debug mode, the files exists in production library not allowed to update.
In the other hand, the files exists in test library allowed to update.
78. When will you use OPEN and CLOSE opcodes in RPG program?
If you specify the letter "U" at columns 73 - 74 in a file description
specification indicating that user control on a file. Hence we have to explicitly
open and close the file in a program.
79. What is difference between fully procedural file and primary file?
In primary file the records will be read and processed from begining to end. This
order is not changed.
In fully procedural file the records will be read and processed in any order. The
logic flow is controlled by the opcodes in RPG program.
80. What is the difference between externally described file and program described
file?
The field definitions and descriptions are defined out side of the program in a
externally described file. The field definitions and descriptions are defined in
side the program in a program described file.
It is always good CLP programming approach to check the object before you
rename, delete the objects on the system.
Display
Attribute Meaning
BL Blinking field
HI High Intensity
RI Reverse Image
CS Column separator
ND Non Display
PC Position cursor
UL Underline
89. What is the purpose of PUTOVR (Put with explicit override) keyword?
Use this record-level keyword to permit the override of either display file
attributes or data contents of specific fields within a record displayed on the
work station device.
92. What is the maximum number of fields under a record format of physical file?
8000 (eight thousand)
103. What are the necessary keywords for the Join Logical file?
JDFTVAL, JFILE, JOIN, JFLD, JREF.
107. What is the use of UNIQUE keyword and what level it is defined?
It will avoid to enter duplicate key values. We have to define it in a file level.
108. At what level S,O are defined and what they will do?
S, O are to defined at key field level. The purpose Select/Omit logic is depends
on the criteria (condition) given at the key field level (At function entry) it
selects and omits the records. The S/O is allowed in Logical file only.
109. What is the difference between Packed decimal and Zoned decimal?
Packed decimal : One digit occupies 1 byte.
Zoned decimal : One digit occupies 2 bytes.
110. What is default data type (if you define decimals '0') in Physical file?
Packed decimal
111. What is default data type for the fields(sub fields) defined in data
structures in RPG?
Zoned decimal
117. What is the maximum number of key fields allowed defining in a physical file?
120
121. How many specifications are there in RPG/400? What are they?
There are seven specifications are exits in RPG/400. They are listed below:
* Header Specification
* File Description specification
* Extension specification
* Line counter specification
* Input specification
* Calculation specification
* Output specification
124. When do you explicitly open files and close files in an RPG program?
If you specify the letter ' U ' at column 73-74, you need to be open and close
files explicitly in a RPG program.
129. What are various techniques to pass parameters from one program to another?
PLIST, CALL, TFRCTL
130. Which single RPG opcode performs both SETLL and READE?
CHAIN
147. What are the two main attributes, which govern the execution of a job?
Run time priority and Time slice
162. What are the different ways to input data into data area?
CHGDTAARA (using CL)
Using OUT opcode in RPG
164. What are the valid user defined data area types?
CHAR, NUMERIC and LOGICAL
169. What are the two types of read performed on data queues?
Read with lock, and read without lock.
177. How to change file attributes such as size, file wait time, record wait time
etc. , permanently?
Using CHGPF command
188. What are the different definition levels in Data Description Specifications?
File level, Record level, Field level, Join level, Keyfield level, Select/Omit
level.
189. What the difference between Source Physical File and Physical File?
A Source Physical File contains the source for the various objects created this
file has specific structure.
A Physical File contains data, and the record format can be different for
different physical files.
192. What is the default value for the number of increment for the physical file?
Three
200. What is the maximum number of records you can specify in a display file?
1024
201. How can a screen field that has changed since the last output operation be
detected ?
Attach the MDT (modified data tag) attribute to the field, to detect whether field
has been changed as a result of user input.
202. What would be the effect on the field where reverse image, underline and
highlight display attributes were active?
The result is same as if you had specified ND.
207. How can a message from a message file appear as a constant on the screen?
By using MSGCON (message constant) keyword.
208. In conjunction with what other keyword must OVRDTA and OVRATA be used?
PUTOVR keyword must used.
218. What is the maximum number of subfiles that can be specified in a display
file,
512
219. Maximum number of subfiles that can Defined in a RPG program for one display
file is
24
220. Maximum number of subfiles that can be active for a single file is?
12
221. Can more than one subfile record be displayed on one line?
Yes, by using SFLLIN keyword.
224. How to pick up the changed records every time in a subfile after the first
change made?
Seton SFLNXTCHG keyword indicator and update the subfile record.
226. How to toggle between single line and Multi - line display of a particular
record in a subfile?
Using SFLDROP keyword.
244. How do you specify page overflow indicator for printer files in RPG?
Specify an indicator in position 33-34 of F specification.
249. Can you specify a display file to be used in the following modes Input,
Output, or Combined modes ?
Yes.
253. What opcode could be used to test an alphanumeric field for all numeric
values?
TESTN
254. What opcode will be used to test the zone of a character field?
TESTZ
267. How can the user implicitly open and close the files in RPG program ?
Enter UC in position 71-72 of F specs.
Use OPEN and CLOSE opcodes in RPG program to open and close files.
271. What is the maximum number of times Multiple Occurrences DS can occur in a
program?
9999
285. How many record formats can you have in a Physical file and in a Logical file
?
Physical file can contain only one record format, Logical file can contain more
than one record format.
347. How do you set pointers to values 55 or next higher or greater? SETGT.
348. How will I explicitly open a file in an RPG program? By defining UC in file
condition and to opening the file mention OPEN opcode and closing the file by
mentioning CLOSE in opcode of C spec.
349. Distinguish between terminating a program through SETON LR and RETURN? LR
closes all the files used in the program and RETURN is used to return the control
to the parent program.
350. How will you add a field to physical file already containing data? With CPYF
command and *NOCHK & *DROP
351. What are the uses of FACTOR1, FACTOR2 and RESULT field for the RPG operation
code PARM? It is add value of FACTOR1 to FACTOR2 or compare the value of FACTOR 2
with FACTOR1.
352. How will you find a string using PDM? By using FNDSTRPDM.
353. How will you search an array? LOKUP
354. What are the different types of arrays? Preruntime gets populated at the time
input. Runtime gets populated at the time execution.Compile time gets populated at
the time of compilation.
355. What is message file? It is file which contain messages created by the user
through which a user can display own message while validating.
356. What does DEFN do? It is used to define a field based on the value specified
in FACTOR 1.
357. What are two types of record are used in subfile? SUBFILE RECORD FORMAT and
SUBFILE CONTROL RECORD FORMAT.
358. What are DDS required for SUBFILE? SUBFILE DISPLAY (SFLDSP) SUBFILE DISPLAY
CONTROL (SFLDSPCTL) SUBFILE CLEAR (SFLCLR) SUBFILE SIZE (SFLSIZE) SUBFILE PAGE
(SFLPAGE).
359. What is ELASTIC and NON ELASTIC SUBRILE? When subfile size is greater then
subfile page size it is called elastic subfile and when subfile size is equal to
subfile page size it is called non-elastic subfile.
360. What is SFLINZ and SFLRNA? SFLINZ stands for subfile initialize. It
initialized all the character field as blanks and numeric fields as zeros. SFLRNA
stands for subfile record not active (It means records are there in the subfile
but active).
361. Can you display a empty subfile? Yes by using the keyword SFLINZ and SFLRNA.
362. Why do we use READC? What is SFLNXTCHG? READC is to read those records which
have changed in the subfile. If you validate a record in subfile on some condition
all the invalid records can display in reverse image. The first which have changed
and made valid and released still displaying in reverse image. The records have
read even it has not been changed due to SFLNXTCHG.
363. How do you read changed records backward in subfile? NOT POSSIBLE.
364. How you will find an error which is not in the first page of the subfile
without using ROLLDOWN key? By using keyword SFLRCDNBR.
365. What is SFLROLVAL? By using this keyword you can tell system to roll on of
records when the user presses ROLLDOWN key (For this you define a hidden of 4
byte).
366. How you will know whether you are in SFLDROP or SFLFOLD mode? Bu using the
keyword SFLMODE.
367. How you get the relative record in a subfile in which cursor is located? By
using the keyword SFLCUSRRN (Subfile cursor relative record number).
368. What is QCMDEXC? It is used to execute a single CL command within the RPG
program.
369. What is maximum size of data area? 9999.
370. How to fire a JOB? SBMJOB.
371. How many levels of security are there on AS/400? There are 10 to 50 level of
security on AS/400.
372. How to translate field values form lower case to Upper case? By using opcode
XLATE.
373. What are the maximum parameters can be passed from one RPG program to another
RPG program? 255
374. How many maximum parameters can be passed from on RPG program to another CL
program? 40
375. How many maximum arrays can be used in a single RPG program? 200.
376. How many maximum loops can be used in a single RPG program? 100
377. How many maximum printer files can be used in a single RPG program? 8
378. What is the maximum length of an OCCUR? 9999.
379. What is a subfile? Subfile is a group of records which can be used for
(Displaying, Adding new record, Modifying the existing record, and Deleting the
existing records).
380. What is maximum size of a subfile? 9999.
381. How do you write and read a value (similarly as EXFMT of RPG) using a display
file in CL? SNDRCVF.
382. How do you display a screen in CL? SNDF.
383. How to check end of file in CL? Monitor the message ID (CPF0864).
384. Can you update a file in CL? NO.
385. Can you add a record to a physical file through CL? NO
386. What opcode is used for submit job? Why it is used? SBMJOB opcode is used and
it is used for background processing.
387. How do you monitor message in CL? By using monitor message ID: (MONMSG MSGID
(CPF0000)
388. Except report design what else can be done by O spec? We can write a Physical
File from O spec.
389. What is the full for of CA and CF? Command Attention and Command Function.
390. Difference between WRKUSRJOB and WRKACTJOB? All the jobs in WRKUSRJOB are
seen including Active jobs where as in WRKACTJOB only active jobs are seen.
391. What are the three levels of SDA? File level, Record level, Field level.
392. What is *PSSR? It is a system subroutine which is executed by default when
any error occurs in a program.
393. Why do we define MOVE *ON *INLR? It frees the memory. All the fields and
parameters in the memory will become blank.
394. How do you shutdown your IBM server? PWRDWNSYS.
395. If your workstation does not show login screen what might be the problem?
Problem with some subsystem.
396. You have given a job for printing and you are not getting the printout what
might be the reason? Some more pending jobs might be there in Job Queue.
397. There are multiple jobs for printing in job queue and you want to print a
important document then what will you do? Change the priority or change the job
queue name.
398. How to see the CPU usage? WRKACTJOB or WRKSYSSTS
399. Which Function key should be pressed to define hidden field while you are
working with SDA? F4
400. Which function key should be pressed to watch all strings defined on the SDA
screen? F20
401. While designing the screen using SDA, which function key should be pressed to
get the field from the field reference file? F10
402. From work with member using PDM screen you have to modify existing member
using SDA, which option do you select? 17
403. Write system defined function used to place system name on the screen?
*SYSNAME
404. While designing the screen, F3 function key is kept common for all record
formats. On which level should it be defined? File Level
405. Write down any two mandatory keywords used when defining a subfile? SFLDSP,
SFLDSPCTL, SFLCTL, SFLSIZ, SFLPAG.
406. While designing the screen user wants to add file level keywords, then which
function key should be pressed? F14.
407. SFLRCDNBR is a FIELD LEVEL keyword
408. While designing the report using RLU, user wants to add record level keyword
then which function key should be pressed? F18.
409. If user wants to add one field on the report then which function key should
be pressed? F11.
410. SDA: After getting field reference from reference file selected files will
appear at the bottom of the screen and then which command function will be used to
get it on screen with its label to be left aligned? &3L
411. If user wants to center the company name on his report then which line
command will be used? CF.
412. If user wants to change the length of the numeric field defined in report
then which combination of keys will be used? F23 & F10.
413. What is difference between SKIPB (2) & SPACEB (2).
414. RLU: If user wants to define new numeric field on record format then which
line command will be used? VF.
415. Maximum report length is 132, if user is designing a report using RLU? FALSE
(378 Max).
416. To change constant field defined on RLU screen which field level keyword
should be used? DFT
417. RLU: Which field level keyword should be used to change any numeric field of
length 8 to 99.99.9999 format? EDTWRD (‘ . . ‘)
418. SPACE and SKIP are FIELD & RECORD LEVEL keywords.
419. SEU shows prompt/syntax checking according to MEMBER TYPE.
420. Using Query, its also possible to create level break reports. TRUE.
421. Using DFU, user will be able to ___________ from Physical File?
Add/Update/Selected or all fields.
422. What is the difference between normal UPDDTA to PF and updating using DFU
program? Both are same only difference is DFU allows you to add or change selected
fields.
423. What is Library? A library is a system object that serves as a directory to
other objects or collection of object
424. What is Library List? A job’s library list defines the path of libraries that
the job follows when trying to locate programs, files or other As/400 objects.
425. Difference between Source Physical File & Physical File? Source Physical File
contains members who contain source statements & Physical File contains members,
which contain data.
426. Types of Libraries on As/400? There are 3 types of libraries on As/400 they
are System (*sys), User (*test) & Product (*prod).
427. Type of Source File & Physical File? Source File: - *PF/SRC Physical File: -
*PF/DTA
428. What’s the use of STRPDM? To work with Libraries, Objects, Members & User
Options.
429. In which Specs can PF be made internally? In I Specs.
430. What is the format of As/400 Commands? Verb Object Qualifier Verb: - action
Object: - on which action is performed Qualifier: - identifies your job
431. What is externally described file? A file, which is created externally &
described in the program, is called as external described file.
432. What is Qualified & Unqualified path? Qualified path means mentioning object
name along with library name while Unqualified path means directly writing the
object name.
433. Which path a good programmer should use? Unqualified path.
434. How many types of files are available on As/400? There are 2 types of files
on As/400 they are Databases files & Device files.
435. What is Logical File? A Logical file is an Access path to the Physical File.
436. How can you specify no duplicate key? By defining the unique key.
437. What is the command to know how many LF are related to a PF? DSPDBR (Display
Database Relationship)
438. What is the command to know key fields of file? DSPFD (F4) *ACCPTH(Access
Path).
439. What is a Join Logical File? A join Logical File can be built over the two
PF’s, with the PF’s ‘joined’ by a common key value. It is available for read
access.
440. Can a Join Logical File be updated? No.
441. What is the object type of PF, LF, Printer file & Display file? *File
442. How many types of display are available on As/400 for user interaction? 4
Types they are Entry, Menu, Information & List Display.
443. Which is the Primary Editor of As/400? Source Entry Utility (SEU).
444. What are the basic features of SEU? Prompt depending upon type, shows right
hand side date & left hand side the line number.
445. What are the different methods to access SEU? Use the Start Source Entry
Utility command (STRSEU) Option 8 from STRPGMMNU Through Program Development
Manager (PDM)
446. Which are the member types which SEU supports? RPG, CL, PF, LF, PRTF & DSPF.
447. In which Specs Arrays, Tables & Constants are defined? In I Specs.
448. What is a Spool File? Printed output items placed in an output queue are
known as spooled files.
449. How many Specs are there in RPG & Which are they? There are 7 Specs in RPG
they are H, F, E, L, I, C & O.
450. Difference between GOTO & EXSR? EXSR is a conditional branching while a GOTO
is an unconditional branching.
451. Difference between CA & CF? CA: - It does not retains the value into the
buffer memory. CF: - It retains the value into the buffer memory.
452. What does EXFMT does? Write & Read.
453. What does the OVRDBF command do? It overrides the PF temporarily for a job.
454. How does the RUNQRY show the output? RUNQRY shows the output always in RRN
(Relative Record Number) & not in keyed sequence.
455. How many printer files maximum can be used in single RPG program? 8 because
of the overflow indicators OA-OG & OV.
456. When you are defining a flat file in your program in F Specs which format
will you specify? Flat File: - F (Fixed Length) Other File: - E (Externally
Described)
457. Difference between skip before & space before? Skip before leaves the
specified no. of lines moving to the next page while Space before leaves the
specified no. of lines on that page.
458. Which indicator is used for Read? EQ (Equal to)
459. Which are the figurative constants used in RPG? *ZERO,*BLANK, *ZEROS,
*BLANKS, *HIVAL, *LOVAL, *OFF, *ON & *ALL.
460. What is the syntax for PLIST? *ENTRY PLIST PARM
461. What are indicators? Indicators are inbuilt class of variables for RPG.
462. What is CAB? It compares Factor1 with Factor2 & if condition is true, control
is transferred to label designated in the result field. The label specified must
appear as the Factor1 of a TAG operation somewhere in the program.
463. Which are the Relational Operators in RPG? GT, GE, LT, LE & EQ.
464. In ‘O’ Specs what is the opcode for write? EXCPT.
465. What is Subroutine in RPG? A subroutine is a group of statements in a program
that can be processed several times in that program.
466. Do we have to Execute the *INZSR compulsory? No, it is a system-defined
subroutine it is executed automatically.
467. What is the use of *PSSR in the program? Whenever there is any type error in
the program the control straight away passes onto this subroutine.
468. Types of Tables in RPG? There are 2 types of tables in RPG they are: -
Compile Time Tables Pre-Runtime Tables
469. What does LOKUP does in Tables & Arrays? The LOKUP opcode searches the
Factor1 entry in table or array.
470. File Access Opcodes? READ, SETLL, SETGT, READE, READP, READPE CHAIN, KLIST,
KFLD, EXCPT & WRITE.
471. What is RPG Fixed Logic Cycle? A logic the compiler supplies is called RPG
Fixed Logic Cycle.
472. Difference between Interactive & Batch Job? Batch job begins, runs &
continues to execute instructions without human intervention or control while
Interactive job are user driven.
473. How can we run a Batch Job? SBMJOB Command.
474. Difference between CALL & SBMJOB? CALL performs interactively job while
SBMJOB performs batch job.
475. Maximum number of Records in Display File? 1024
476. What does VLDCMDKEY means? Valid Command Key.
477. What is the error if we don’t get login screen? There is some problem with
subsystem.
478. How to run other job when one job is active? Change the priority or rename
the job.
479. Use of Data Structures?
• Dividing a field into sub fields.
• Changing the format of a field.
• Grouping non-contiguous data in a contiguous format.
• Defining an area of storage in more than 1 format.
485. Which are the libraries (system) always present in the library list? QTEMP &
QGPL
486. Which users are allowed to manipulate system libraries? QSECOFR & QSYSOPR
487. Can the objects stored in the product library be modified? No.
488. How many types of objects are there on As/400? 80
489. How is data stored in PF’s? In fixed length records.
490. Give an example of DEFN opcode? *LIKE DEFN ENAME $ENAME (Now the $ENAME has
all the attributes same like ENAME)
491. What is DBMS? A DBMS is a software system that controls the creation,
organization & modification of a database & access to the date stored within it.
492. What is a Join Logical File? A Join Logical File combines information from
two or more physical files into one record format. Join Logical Files have always
one record format.
493. Types of Object Locks & what they do? There are mainly 3 types of locks they
are as follow: - *EXCL : Only the routing step holding the lock can use the object
*EXCLRD : Routing step can read/update the file other jobs can only read. *SHRUPD
: All jobs can read/update the object.
494. How do you place or remove locks on the objects? *AACOBJ & *DLCOBJ
495. Some of the object types on which locks can be allocated? Data Area, Data
Queue, File, Library, Message Queue, Menu &Program.
496. What is the opcode to release all the locks on a particular PF? UNLCK
497. What is a trigger? A trigger is an action that automatically occurs whenever
a change Is made to a physical file.
498. How many triggers can be associated with a single PF? 6 (max)
499. How can we know the triggers associated with the PF? DSPFD with parameter
TYPE (*TRG)
500. How can we add & remove trigger to a PF? ADDPFTRG & RMVPFTRG
501. F is the type of file desg. Used for externally described files given when
file types are? I & U
502. What is an Output Queue? They are the holding areas that store printed output
generated from Batch programs or Interactive applications.
503. What does print writer do? It is a system job that selects files from the
output queue & prints Them on a printer. It provides the interface between output
queue’s Spooled files & the printer.
504. What are the 2 types of lines on O Specs? Record Identification Line & Field
Identification Line.
505. Can a Subroutine contain another Subroutine? No.
506. Does the SETLL & SETGT retrieve the record? No, they simply position to the
record.
507. What is a table? A table is collection of data elements in one column, data
elements Must be of same type and same length.
508. What is a Compile Time Table? We can hard code data within the program is
said to be Compile Time Table.
509. What is a Run Time Table? Data from a separate disk file is loaded into a
table each time the Program runs.
510. Give the Table definition? TABMT 1 12 2 A Where 1 = Number of entries per
record 12 = Total number of entries 2 = Length of each entry A = Ascending Sequene
511. If the data is likely to change over a period of time & Moreover data is
large than which type of table is preferred? Compile Time Table.
512. What is Alternate Table? RPG tables stores information in 1 column. To store
information in multiple columns, it uses the concept of Alternate Table.
513. What is an Array? Array is a collection of data, the data elements must be of
same Length and same type.
514. The Qualified name for an object ORDPF residing in a library TRAINING is?
TRAINING/ORDPF
515. The members in a Source Physical File contain? Source statements for a
program.
516. The members in LF contain? Access Path.
517. The members in a PF contain data? (True/False) True
518. What is the command to view the library list? DSPLIBL
519. What is the command to create PF? CRTPF
520. The LF is associated with how many PF’s? At least one PF at a time.
521. The function key to start SEU session through program development manager is?
F6
522. The Member type for an RPG & CL program which SEU supports is? RPG & CLP
523. Printed output items placed in an output queue are known as? Spool Files.
524. When a spooled file is created, it is placed into an? OUTQUEUE
525. The command to display a list of spooled files? WRKSPLF
526. Change in the externally described file does not require recompilation of the
program? (True/False) False
527. Command to display current library is? DSPCURLIB
528. A PF can have how many record formats? Only one
529. Which one of the following has the highest priority Library on top of the
library list, Library QGPL, Library on the bottom of the library list & Current
library? Current library
530. Consider the following command: WRKOBJ OBJ (*ALLUSR/DBTMEF) Object DBTMEF in
all libraries except system libraries.
531. While designing the screen user wants to add file level keywords then which
function key is pressed? F14
532. While designing the report using RLU user wants to add record level keywords
which function key is pressed? F18
533. If user wants to add one field on the report then which function key is
pressed? F11
534. If user wants to center the company name on his report then which command
will be used? CF (Center Field)
535. SEU shows prompt/syntax checking according to? Member Type
536. It is possible to run Query using RUNQRY command? YES
537. Using Query it is possible to create level break report? YES
538. Using DFU user can do which operation? Add, Update & Select fields
539. What is the difference between UPDDTA to PF & updating using DFU? Both are
same, only difference is DFU program allows you to add & update selected fields.
540. Which function key should be pressed to define hidden field while you are
working with SDA? F4
541. Which function key should be pressed to watch all string defined on SDA
screen? F20
542. While designing the screen using SDA, which function key should be pressed to
get the field from the FRF? F10.
543. From WRKMBRPDM screen you have to modify existing member-using SDA which
option do you select? 17.
544. Write system defined function used to place system name on the screen?
*SYSNAME
545. While designing screen F3 function key is kept common for all record formats
on which level should it be defined? File level
546. Write down mandatory keywords used when defining a subfile? SFL, SFLDSP,
SFLSIZ, SFLCTL & SFLPAG
547. If user wants to change the length of the numeric field defined in the report
then which combination of the keys will be used? F23 & F10
548. What is the difference between SKIPB (2) & SPACEB (2)? SKIPB (2) skips 1 page
& on the next page after skipping 2 lines space print next while SPACEB (2) skips
2 lines space before printing.
549. RLU: If user wants to define new numeric field on record format then which
line command will be used? VF
550. Maximum report length is 132, if user is designing a report using RLU? FALSE
(Maximum is 378)
551. To change constant field defined on RLU screen which field level keyword
should be used? DFT (Default)
552. Space & Skip are which level keywords? Field & Record
553. A Join Logical File has how many Record formats? 1
554. A Multiple format Logical File is also known as? Union File
555. How does Union file maintains Record formats? 1 Record format for each PF
556. What is full form for DDS? Data Description Specification
557. What are members? Members are separate entities within a database file & they
are components of As/400 object.
558. What if RPG, when & who invented it? Report Program Generator is IBM
introduced a High Level Language in 1960.
559. For, which purpose is H Specs used? Writing header information, date
separator, currency symbol etc.
560. What is the size of the filename in RPG? 8 Characters (Max.)
561. Which are the different File Types in RPG? I (Input), O (Output), U (Update)
& C (Combine).
562. What are the different File Designation Types in RPG? P (Primary) & F (Fully
Procedural)
563. What’s the use of File Designation in RPG? It refers to the way program will
access or retrieve the data from the file.
564. What are the different File Format Types in RPG? F (Fixed Length) & E
(Externally Described)
565. What is the use of File Format in RPG? It tells to the program that the
records are within the program (F) or outside the program (E).
566. What is L Specs for? To tell length of page & number of lines to be printed
on a page.
567. What is I Specs for? To describe the records within Program described file,
fields, constants, divide fields into sub fields & to form a group of fields.
568. How many maximum spaces could be given in O Specs? 3
569. Which are Control Break Logic indicators? L1 – L9.
570. What are Data Structures? Data Structures define an area of storage & layout
of fields within the defined structure.
571. Which are the four keywords supported by Program Status Data Structure?
*STATUS, *PARM, *ROUTINE & *PROGRAM
572. Which are the String Manipulation Opcodes? TESTN, SCAN, CHECK, CHECKR, SUBST
& CAT
573. DB2 is a type of Database? It is an Integrated RDBMS.
574. An access path may be in which sequence? It can be in Arrival & Keyed
sequence
575. Records can be Read/Update/Deleted with which file? Simple Logical File &
Physical File.
576. Which type of object is used in DB2/400? *FILE
577. What is SQL? SQL is an interface for programming language.
578. File level entry for a PF can be? UNIQUE & FIFO
579. Command to create FRF? CRTPF
580. Join Logical File displays data from how many files? 2 or more PF’s
581. A Query can be displayed without saving it? True
582. Which are the Query selection criteria, which can be given in a Query? LIST
583. To add a file to the ‘File Selection’ option of a Query, the function key to
be pressed is? F9
584. A Query can be run in which mode? Batch & Interactive
585. What does DFU program you to do on a record? Insert, Update Delete & File
Enquiry.
586. When are the Unique Constraints executed? During Insert.
587. When are the Referential Constraints executed? Insert, Update & Delete.
588. How many triggers can be associated with a file? 6(Maximum)
589. Why is the Declare cursor statement is used for? To define & name the cursor
& specify rows to be fetched.
590. What do we can do with the Embedded SQL statements? We can
Insert/Update/Delete records, fetch records, fetch values from records into
variables.
591. What is the values SQLCOD when there is an error in fetching the records
specified in the select statement? -ve value
592. A file cannot have more than 1 unique key? False
593. DLCOBJ command is mandatory for removing lock on any object? False
594. What is a Journal? A Journal is an object used primarily to record changes to
data in a PF.
595. Which are the DB2 tools to protect Integrity of the database? Journaling &
Commitment Control, Referential Integrity Embedded SQL & Object/Record Locks.
596. A program variable coded in an Embedded SQL statement is referred to as? Host
Variable
597. Which of the CL command can be used to determine which logical files are
dependent on a specific file? DSPDBR
598. Which CL command is used to trap error messages during program execution?
MONMSG
599. Which CL command can be used at program execution to redirect the file named
in an RPG program? OVRDBF
600. What is the length of the variable in the given example? DCL VAR (&Name) TYPE
(*Char)? Default 32 & for Decimal 15,5
601. Which of the following CL command us used to display a screen & wait for the
user to press enter or a function key? SNDRCVF
602. A CL program, EMPCL1 calls the RPG program EMP001 & the calls the RPG program
EMP002.RPg program EMP001 & EMP002 were both written to process the file, In order
to test changes in EMP001 a test file called TESTEMP is library TESTLIB needs to
be used EMP002 should process EMPMAST as it normally would. Add the following CL
statement directly before the call to EMP002 DLTOVR FILE (EMPMAST)
603. What is command to convert the date format in CL? CVTDAT
604. What is command to write or update to a database file in CL? No command
605. What is the command for retrieving user profile attributes? RTVUSRPRF
606. What is the command to display the Data Area “Name”? DSPDTAARA “Name”
607. What is the command to submit the Batch Job? SBMJOB
608. Submitting a job using numeric parameters, the length of the parameter should
be? 15,5
609. What will be the attributes of the output report. OVRPRTF FILE (Output)
SPLFNAME (Reports)OVRPRTF FILE (Output) COPIES (3)CALL PGM (Rpg001) Copies = 3
610. Command to retrieve attributes of a job? RTVJOBA
611. Only 1 file can be declared in CL program? True
612. Command in CL to copy a Query to a database file? CPYFRMQRYF
613. Command CLOF stands for? Closes the database file.
614. Command OPNQRYF stands for? Opens a database file to a set of database
records that satisfies a database Query request.
615. Command OVRDBF stands for? Override (replace) the file named in the program &
Override certain parameters of a file that are used by the program.
616. Can you debug RPG III program with STRDBG? YES & Vice versa NO
617. Which of the following options describes the result of using the USROPN
keyword? This file must be opened with an explicit OPEN operation prior to
accessing this file.
618. What is the type of the Array in the following code?D Arr S 30A Dim (30)
PerRcd (1) CTADTA Compile Time Array
619. Given the following code segment.D PGMNAME S 20A Inz (‘THX1138’)C CALL
PGMNAMEC PARM P1 5 The CALL to the program name stored in the PGMNAME field ends
in an error, the program is not found.
620. Which of the following methods will make externally describe file fields
available to a program? A Data Structure definition specification that names the
file on the EXTNAME keyword.
621. In the following code %SUBST is aEval Result = %SUBST (Flda: Str: Len) Built
in function
622. What ILE RPG/400 code procedures the same results as the RPG/400 code shown
below?C A Add B Sum1 Sum1 Mult X Rslt Rslt Div Tot Answ C Eval Answ = (A+B)*X/Tot
623. The DATFMT keyword allows you to specify which of the following date format?
*USA
624. What is the command invoked when we give option 14 to RPGLE program?
CRTBNDRPG
625. What will happen, if we use STRISDB command for RPGLE program? Error: Program
type not valid
626. If we want to define a new variable $Aprid with same attributes as field
Crpid, the RPGLE code look like this: D $Aprid S Like (Crprid)
627. The keyword used to define number of entries per record for Tables/Arrays in
RPGLE is? PerRcd (n)
628. What will be the output of the following ILE code?D Loandate S D DATFMT
(*USA) Inz (D’12 31 92’)UBDUR -30: *D Loandate
629. Which will be the output of the following ILE Code?D Answer S TC T’12:00PM’
ADDDUR 12: *Hours Answer 00.00 AM
630. Which of the following Specs. Is not used in ILE? E Specs.
631. Which is the Built in function to convert numeric field to Alpha field?
%EDITC, %EDITW, %CHAR
632. If user wants to retrieve the time in microseconds, what Would be data type
of the field? Z
633. Subprocedures can use RPG cycle? False
634. RPGLE supports which calls? Static & Bound
635. State whether the following code is correct?@Arr is an array. No of elements
= 5, & Length of each element = 3A.C Movel ‘ABC’ @Arr, X False
636. How many files can be opened in RPG IV program? No Limit
637. For CHAIN, SETLL, SETGT, READE, READPE & READE where indicators are given &
their success? Opcode Success Indicator CHAIN OFF HI READ, READE, READP, READPE
OFF EQ SETLL ON EQ SETGT ON HI
638. What does XFOOT, MOVEA & SORTA does? XFOOT: - Sums the elements of an array
SORTA: - Sorts the array in ascending order but if while declaring the array
Sequence is defined as D it arranges in descending order. MOVEA: - Transfers
valued from Factor2 to the Result field of the Operation but one of them must be
an array
639. Advantages of ILE or RPG?
1) In RPG it is one step compilation (we will get *PGM object) while in ILE-RPG it
is two step compilation (we have to create a *MODULE and then bind that module to
a program.
In RPG we cannot call a program i.e. recursive call is not supported. While in ILE
RPG it is supported.
Extended Factor 2
Length of Factor 1 & 2 is increased to 14 as well as Length of OP-CODE is 10
Free format is allowed
Built-in-functions are available.
In case of ILE we have the concept of ACTIVATION GROUP.
In ILE EPM (Extended Program Model) is implemented while in RPG OPM (original
program model)
640. What is sub-file?
It is group of records read from or written to display file in a column format. It
is always a subset of records from physical file hence the name subfile.
641. SFL and SFLCTL ?
There are the two mandatory key words for subfile program /design. While SFL is
used to define Subfile record format while SFLCTL is used to define Subfile
Control Record format. And this two are the different parts of sub-file.
642. What are the Sub file Types?
There are three types of sub file
Load All - In which all the records from the Physical file or at max. 9999 records
are written to subfile. Here sub file size should 9999 or the number of records
form PF which ever is less. In this case PAGEUP AND PAGEDOWN is taken care by
system. SFLPAG should be less than SFLSIZ
Single Page/non-elastic – In this case sub file size (SFLSIZ) must be equal to sub
file page (SFLPAG). For example, if SFLSIZ = 10 and SFLPAG = 10, then 10 records
from file are written to subfile. In this case PAG
656. In case of Load all sub-file, if we type options and then PGDN,PGUP , will
options be there on the display / in subfile.
Yes. It will retain all the options entered in the previous page.
657. How will you take care of multiple options in case sub-file?
We will have to handle it within the program using a READC in a loop.
658. If we type some options on screen out of which some are invalid and pressed
enter, what should happen?
It should process all the valid options before invalid options encounter. Once
invalid options is encountered program should stop processing and display error
message at the bottom of the scrreen.
ENDSR
It does not contain a program entry procedure. This means that you cannot call a
service program using the CALL operation.
A service program is bound into a program or other service programs using binding
by reference.
677. If we tried to move year part of *ISO date into a field of length 3, what
will happen ?
Program crashes, as in case of *ISO format it required fields of 4,2,2.
680. OVERLAY
It allows a record format to be displayed on screen retaining the previous
displayed record formats.
688. What is the stored procedure and how do you define a stored procedure.
A stored procedure is a program that can be called to perform operations that can
include both host language statements and SQL statements. Procedures in SQL
provide the same benefits as procedures in a hot language. That is, a common piece
of code need only be written and maintained once and can be called from several
programs. Stored procedures can be used in both distributed and non-distributed
applicaitons.
We can have parameters as IN , OUT , INOUT type. Language can be RPGLE, C, CL,
etc.. MYLIB/PROC1 this PROC1 is a program written and compiled separately and it
is of language which you are specifying in section LANGUAGE.
689. Writing an SQL statement from selecting records from TWO files using single
statement and Nested select statement.
Using Single statement.
SELECT * FROM FILE1, FILE2
WHERE FILE1.FLD1 = FILE2.FLD1
Type of constraints
*REFCST - A referential constraint is being added
*UNQCST - A unique constraint is being added.
*PRIKEY - A primary key constraint is being added
*CHKCST - A check constraint is being added
*RESTRICT –
Updating a record in a parent file is permitted if data for a non-null parent key
does not match data for a foreign key.
Updating a record in a parent file is restricted if data for a non-null parent key
matches data for a foreign key.
693. Can we have records (with fields from more than one file) from multiple files
and Nested / sub query in SQL ?
Yes, we can have record from multiple file with join condition and we also can
have nested query or subquery like SELECT * FROM FILE1 WHERE FILE1.FLD1 IN (SELECT
FILE2.FLD1 FROM FILE2)
698. Can we update database file with the help SQL Cursor ?
While declaring the cursor if we specify FOR READ then we cannot update but if we
specify FOR UPDATE or nothing (by default is FOR UPDATE) then we can update
database file.
700. What will happen if we call stored procedure again and again ?
It the creation of procedure is included in the called program, then we can have
different set of output depending upon the parameter passed to it. And If creation
is outside the called program then we will be available with only one set of
output.
Miscellaneous
713. What kind of job is it --- you have signed on AS400 and then typed Call XYZ
and pgm XYZ is an RPG program which simply reads a database file and generates
report.
It is not a job.
719. How many record formats can you have in a Physical & Logical file?
Physical file can contain only one record format where as Logical file can have
more than one record format.
720. Which is the better option to write a transaction (order header and detail
transaction) using two physical files or one join logical file(on those two
physical files) in a program and why ?
Using two physical files is the better option because records can't be written
through join logical file.
721. Can we have a multi record format join and non join logical file based on one
physical file ?
We can only have Join logical file based on one physical file.
723. What is difference between Multi record format Join and Non- Join logical
file ?
Multi record format logical file contain more than one record format( based on one
or more physical file) With join logical file only read operation can be done
whereas in non-join logical file all operations can be done.
726. Can a file be used under commitment control without being jorunaled ?
No
729. What are different types of Arrays and what is the difference between them ?
There are 3 types of arrays Compile time, Pre-Run time and Run time. Compile time
array gets value at the time of compilation of the source of a program. Pre-run
time array gets value from a file at the beginning of a program execution (before
any statement of a program is executed). Run time array gets value during the
program execution.
732. Can an indexed file (File with key fields) be accessed in arrival sequence in
an RPG program ?
Yes, don't specify "K" in F specification in the program for this file.
733. What is the difference between *LIKE and *NAMVAR opcode?
*LIKE defines program variable same as that of another pre defined variable.
*NAMVAR is used to define variable as Data area.
736. How will you display a particular page (or record) in a Sub file?
Move a valid relative record number(RRN) in the field specified using SFLRCDNBR
keyword in DDS
737. What is difference between Command Function and Command Attention key?
Command function key returns variable value along with response indicator
(associated with CF key) where as Command attention returns only the response
indicator value.