Upload
sufiyan-kakingarae
View
242
Download
1
Embed Size (px)
Citation preview
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
1/68
AS400TUTORIAL.com Page
www.AS400Tutorial.com
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
2/68
AS400TUTORIAL.com Page
Terms & Conditions / Disclaimer
This
collection
is
made
possible
by
multiple
contributions
by
well
wishers
like
you.
Whileeveryeffortismadetoensurethatthecontentofthiswebsite/ebook isaccurate,theinformationis
providedonanasisbasisandAS400TUTORIAL.COMmakesnorepresentationsorwarrantiesinrelationtothe
accuracyorcompletenessoftheinformationfoundonit.Whilethecontentofthiswebsite/ebook isprovided
goodfaith,wedonotwarrantthattheinformationwillbekeptuptodate,betrue,accurateandnotmisleading,
orthatthissitewillalways(orforever)beavailableforuse.
Wedonotwarrantthattheserversthatmakethiswebsiteavailablewillbeerror,virusorbugfreeandyouacce
thatitisyourresponsibilitytomakeadequateprovisionforprotectionagainstsuchthreats.Werecommend
scanninganyfilesbeforedownloading.
Nothingonthiswebsiteshouldbetakentoconstituteprofessionaladviceoraformalrecommendationand
AS400TUTORIAL.comherebyexcludesallrepresentationsandwarrantieswhatsoever(whetherimpliedbylawo
otherwise)relatingtothecontentanduseofthissite.
InnoeventwillAS400TUTORIAL.COM beliableforanyincidental,indirect,consequential,punitiveorspecial
damagesofanykind,oranyotherdamageswhatsoever,including,withoutlimitation,thoseresultingfromlosso
profit,loss
of
contracts,
loss
of
reputation,
goodwill,
data,
information,
income,
anticipated
savings
or
business
relationships,whetherornotAS400TUTORIAL.comhasbeenadvisedofthepossibilityofsuchdamage,arisingou
oforinconnectionwiththeuseofthiswebsiteoranylinkedwebsites.
Byusingthiswebsite/ebookyouagreetothestatementsabove.Intheevent,youshallnotagree,youshallstop
usingthiswebsite/ebookanddeleteanycopiesyouhavefromtheharddrive.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
3/68
AS400TUTORIAL.com Page
1. 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 and a multiple occurrence data structure?
The values stored in array dont vary. In the other hand, we can store theDifferent values in same variables at
various stages.
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 initializes the variables.
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.
5. What is the purpose of the "N" in the following calculation specification?
C KEY CHAIN FILE N 99
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?
C MOVE *ZEROS FLDAC Z-ADD *ZEROS FLDA
C Z-ADD 0 FLDAC MOVE *ALL'0' FLDA
C SUB FLDA FLDAC MOVE '0000' FLDA
C CLEAR FLDAC MOVE *BLANKS FLDA
The last instruction does NOT zero the field FLDA.
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 isdescribed below:In File description continuation line (IPFK),KINFDS RCDSIRCDS DSI *RECORD #RCDSwith 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 generate
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.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
4/68
AS400TUTORIAL.com Page
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 t
be sent, variable to store the information to be sent. We can send the same data queue to the many programs.
10. What is the purpose of the following?I 'CLOSED' C STAT01I '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?
UDATE supports two-digit year. The format is *MDY (MMDDYY).*DATE (systEM date) supports four digit year. Th
format is *MDYY (MMDDYYYY).
12. List some of the commonly used commands for debuggingSTRDBG(for batch jobs), STRISDB.
13. Define the RCVF command?
RCVF command used to receive the records either from the data base file or device file.
14. Define the purpose of the %SST function?
To extract the information from the specified string.
15. Define the 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 blank in a resultant.
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 on
time
18. Define the purpose of the LEAVE operation?If you specify 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 statements are allowed to
execute repeatedly.
20. List the steps/commands necessary to accomplish the following:a. Copy data from the file ORDHDR into file
ORDHISTb. The file ORDHIST may or may not existc. If the file ORDHDR does exist, it may or may not contain
datad. The file ORDHIST may or may not contain data, if the file does contain data the old data should be
erasedCommands:
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
5/68
AS400TUTORIAL.com Page
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
21. What is the purpose of the following?FORDHDR1 IF E K DISKORDHDRF KRENAMEORDHDRF1In 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 compi
Hence we have to rename either of the file.
22. What is the purpose of the followingC/COPY QRPGSRC,ORDERR
During the compilation the source code of ORDERR copy book is copied into the existing program. Where as /COP
is compiler directive statement.
23. What is the purpose of the followingFORDHDR1 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.
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-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.
25. What is the purpose of the following?A CSRLOC (F1ROW F1COL)
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 :
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
6/68
AS400TUTORIAL.com Page
For more information
Please visit our website
www.AS400TUTORIAL.com
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
7/68
AS400TUTORIAL.com Page
First it clears the subfile and initiliazing the numeric variables with zeros and alphanumeric variables with
characters.
27. Define the purpose/use for SFLRNA?
Using this, we can make specified subfile record format inactive.
28. Define what the operation will do, the purpose of the result field and the purpose of *IN66?HI LO EQC CALL
'CVTDAT' DTPRM 66
The above statement causes, call the program and pass the parameter.
29. Define each of the following operation codes
a. READ To read the records sequentially
.b. READE To read the equal key records
c. READP To read the previous records
d. READC To read the records from the workstation file (Subfile).
e. REDEP To read the equal key previous records
.30. Define the purpose of the following code (If you know, how would this be written in RPG ILE)HI LO EQC *IN6
DOUEQ *OFFC KEY1 CHAIN FILEA 90 66C 66 CALL PGM1 PRMC ENDDO
Whenever the indicator *IN66 becomes *OFF, the control transfers after ENDDO statement. Otherwise, it reads th
records from the data base file based on indicator specified on HI position. If the specified indicator on LO positio
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?
SFLSIZ > SFLPAG.
32. When would you use or not use this approach?
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, whe
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?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
8/68
AS400TUTORIAL.com Page
You specify the indicators OA through OG and OV in 33 - 34 columns in a printer file. This indicator automatically
set on whenever overflow occurs on a type of page.
35. How would you design the process for a nightly, high volume check producing process that needs to select onrecords that are flagged to be processed?
With the help of OPNQRYF Clp command, we can select the records from the data base file. The process involves
following steps:Steps: 1. OVRDBF with SHARE (*YES)2. OPNQRYF3. CALL the program4. DLTOVR5. CLOF
36. How would you join 3 separate fields, a first name, middle initial and last name together as 1 field with prope
spacing?
You can describe in either RPG and/or RPG ILE (Integrated Language Environment)
MOVE 'Dr. ' FNAME 3MOVE 'JOHN' MNAME 4MOVE 'WATSON' LNAME 6FNAME CAT MNAME: 1 VAR1 8VAR1 CAT
LNAME:1 VAR2 15DSPLY VAR2MOVE *ON *INLR37. 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 *INZS
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)
1) CVTDAT DATE() RTNVAR( ) FROMFMT( ) TOFMT( )Source code is required to convert from one date format to
another date format.The source code in CLP is given below:PGMDCL 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
39. Determine the value of the result fielda.
Cost = $110. 00b. Tax = 20%c. MarkUp= 05%d. Sale = 10%C Eval TotalCost = ((Cost * MarkUp) * Tax)) - Sale=
1. 0$40.
Define the purpose of Factor 1 the Operation Code and *IN15 in following codeHI LO EQC *YMD Test(D)
yymmddDate 15
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
9/68
AS400TUTORIAL.com Page
If the factor 1 value matches with factor2 value, the indicator specified in EQ comes *ON.
41. Describe the function of SETLL operation in RPG language?
The SETLL operation positions a file at the next record with a key or relative record number that is greater than o
equal to key or relative record number specified in factor1
.42. Describe the function of SETGT operation in RPG language?
The SETGT operation positions a file at the next record with a key or relative record number that is greater than
key or relative record number specified in factor 1
.43. What is the purpose of Level Check parameter in a Physical file?
Specifies whether the level identifiers of the record formats in the physical file are checked when the file is opened
by the program.
44. Define a Job Queue?
Job queues are queues of batch jobs waiting to be processed.
45. Define a Output Queue?
Output queues are queues of jobs waiting to be printed.
46. What is the function of CPYSPLF command?
It copies the spooled file to the data base file.
47. What is the function of CPYF command?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
10/68
AS400TUTORIAL.com Page
To copy the data from the one file to another.
48. What is the function of CRTDUPOBJ command?
To create the replica from the original object.
49. Define Subsystem?
Subsystem is nothing but it provides specialized environment to complete the execution of jobs.
50. What are different types of Substems?
QBATCH, QINTER, QSPL, QCMN, QCTL, QBASE.
51. Define a Batch Job?
* A user request the job.* The job is created (job name is assigned, job attributes are allocated)* The job is place
on a job queue* The sub system QBATCH takes the job from job queue and starts it.* Output generated by the
batch job is placed on an output queue.* The spool sub system prints the output on the output queue.
52. Describe about Query/400?
Query/400 is a licensed program that uses a query to analyze and select the information contained in the data ba
files and create a query report.A query report can be:* displayed on a workstation (screen)* printed* stored in
another database file.
53. What is the CLP command to access a Query/400?
WRKQRY
54. Purpose of Overrides?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
11/68
AS400TUTORIAL.com Page
The basic purpose of Overrides is to temporarily change the attributes of a file. So you don't have to create
permanent files for every combination of attributes your application might need. Overrides gives you the flexibility
to use existing model files and dynamically change their attributes.
55. Define Data Structure?
Data structures are specified in the Input specifications of an RPG/400 program to define an area in storage and
layouts of related sub fields
.56. What is the purpose of Data structure?
* Divide a field in to sub fields* Change the format of a field* Group non-contiguous data in a contiguous format*Define an area of storage in more than one format* Define Multiple occurrences of data structures.
57. List and explain the different type of data structures?
* Data area data structureWhen the data area is defined in an RPG/400 program as a data area data structure, its
data is implicitly retrieved for processing and written back at the end of the program. In the data area data
structure, letter "U" must be entered to define the data structure as a data area data structure.* File information
data structureA file information data structure provides exception/error information that may be occurred when
processing a file during program execution. This type of data structure contains pre defined sub fields that identifThe name of the file for which the error occurred* The record processed when the error occurred* The operation
being processed when the error occurred* The status code number* The RPG/400 routine in which the error
occurred.Exception errors may be controlled by testing for an error code in the *STATUS field which is included in
file information data structure. Specifically, keywords including *FILE, *RECORD, *OPCODE, *STATUS, *ROUTINE
provide the previously named information.* Program status data structureProgram status data structure however
identity exception/errors that are generated in the program by RPG/400 operations and not by a file. Note that an
code greater than 00099 is flagged as an exception/error. Four keywords - *STATUS, *ROUTINE, *PROGRAM,
*PARMS are supported by a program status data structure
.58. What is the purpose of DYNSLT keyword?
This is a file level keyword used in a logical file. If you specify this in a file level, the system doesn't perform recor
selection until the program reads file. Then on the Select/Omit criteria, it selects the records from the specified file
59. What is the difference between access path and Dynamic select?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
12/68
AS400TUTORIAL.com Page
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.
60. Why would you prefer OPNQRYF than logical file?
The main difference is : Logical file creates permanent object on the system. OPNQRYF creates temporary access
path
.61. When would you prefer logical file than OPNQRYF?
The physical file you are working with very large, creating and using a logical file will allow an application to
perform faster than using an open query file. Since access paths created by open query files are temporary,applications that use an access path frequently will be more efficient using a logical file, since the access path will
not have to be rebuilt every time the file is open.
62. What the purpose of the keywords FIFO, LIFO, FCFO?
These keywords are used at file level. The purpose of each one is described below:FIFO: The duplicate key record
will retrieved in first in first out order.LIFO: The duplicate key records will retrieved in last in first out order.FCFO:
The duplicate key records will retrieved in first changed first out order.
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 sam
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 mad
changes in physical file.
For more information
Please visit our website
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
13/68
AS400TUTORIAL.com Page
www.AS400TUTORIAL.com
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
14/68
AS400TUTORIAL.com Page
64. Distinguish between logical file and physical file?
Physical file contains only one record format.Logical file contains more than one record format.Physical file contain
actual data.Logical file doesn't contains data but it provides view from the physical file.
65. What is field reference file?
Field reference file is a file, which contains field definitions and descriptions, and it doesn't have member. Physica
contains data derived by the field reference 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)
67. What is the purpose of reorganizing the physical file i. e. , RGZPFM?
Even if you delete the records in a physical file through the program, still the space used by the deleted records n
used by the other purpose. Hence using RGZPFM command we can compress the deleted records space.
68. What is the purpose of CHGPF (Change physical file) command?
CHGPF command is used to change the attributes of a physical file. Attributes like* Maximum number of members
Member size* Level check enforced* Open data path is shared
69. What is purpose of declarative statement DEFN?
Depends on the factor 1 value it will do two things:* If the factor1is *LIKE then DEFN opcode defines the new fie
based on the attributes old field.* If the factor 1 is *NAMVAR then DEFN opcodes defines the field as a data area.
70. What is the purpose of SFLNXTCHG keyword in a subfile?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
15/68
AS400TUTORIAL.com Page
Which is a subfile record format keyword. If you perform read on the subfile, theinternal indicator MDT (modified
data tag) is automatically set off by the system. If you again perform read on thesame records, records won't be
read. Because internal indicator MDT would be off. Hence you should be explicitly seton the MDT by SFLNXTCHG
keyword.
71. What is the difference between Array and Table?
Array: Array is stored any where in the body of the input records.Table: Table is stored at the begining of the inpu
records.Array: We can access all the elements in array by specifying the array name.Table: Only one table elemen
can be accessed at a time.Array: Array can be searched randomly.Table: Table can be searched consecutively.
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 t
a file.Rebuild- only open access paths will update whenever changes made to the file. Rebuild takes place whenev
remaining access paths will be open.Delay : Rebuild will not takes place.
73. How can you identify End of file in CLP program?
With the help of MONMSG MSGID(CPF0864) we can identify end of file in clp program.
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 tes
library allowed to update.
75. What is message subfile?
Message subfile is special file contains multiple messages taken from program message queue and placed in
message sub file for display on the screen.
76. What are necessary keywords to code message subfile?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
16/68
AS400TUTORIAL.com Page
SFLMSGRCD, SFLMSGKEY, SFLPGMQ
77. What is the difference between SETON LR and RETRN?
If you specify SETON LR, all the files used in program will be closed.If you specify RETRN, all the files used in
program will remain open.
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.
81. How many primary files allowed in a program?
Only one primary file is allowed in program.82. How many secondary files allowed in a program?More than one
secondary files are allowed in a program.
83. What is the purpose of RTVMBRD command?
In order to access the information related to member, we can RTVMBRD command.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
17/68
AS400TUTORIAL.com Page
84. Define an Interactive Job?
* A user requests a job.* Job is created and job name, job attributes are assigned.* Job is placed on a job queue.
The sub system QINTER takes the job from the job queue and starts processing.* The output generated by the
interactive job is placed on the output queue* The spool sub system QSPL prints the output
.85. How can you check the existence of object in a system?
With the help of CHKOBJ clp command, we can find existence of object on the system.The usage of command in
clp is as follows:CHKOBJ OBJ(JBA001DT) OBJTYPE(*DTAARA)MONMSG MSGID(CPF9801) EXEC(DO)CRTDTAARA
DTAARA(QGPL/JBA001DT) TYPE(*CHAR) LEN(6) +VALUE('010196') TEXT('The last day that had job acct.+data
extracted')ENDDORTVDTAARA DTAARA(JBA001DT *ALL) RTNVAR (&FROMDATE)The execution of above steps is
listed below:steps1: First it checks the data area object on the system.2: If the data area object not found, the
MONMSG command executes withthe help of message identifier, next we can dynamically create the data area.3.the data area object found, control transfers to statement below ENDDO.It is always good CLP programming
approach to check the object before yourename, delete the objects on the system.
86. What is the purpose of FRCDTA (Force Data) keyword?
Use this record-level keyword to immediately display a record format, without waiting for the next input or
output/input operation.
87. What is the purpose of SFLFOLD and SFLDROP keywords?
SFLFOLD: To fold the second line of multiple line subfile.SFLDROP: To drop the second line of multiple line subfile
88. What is the function of DSPATR (display attributes) keyword?
Use this field level keyword in display file to specify one or more display attributes for the field you are defining.
You can specify the DSPATR keyword more than once for the same field, and you can specify more than oneattribute for the same keyword. The following are valid attributes:For All FieldsDisplayAttribute MeaningBL Blinkin
fieldHI High IntensityRI Reverse ImageCS Column separatorND Non DisplayPC Position cursorUL UnderlineFor
Input-Capable Fields OnlyPR Protect contents of field from input keyingMDT Set modified data tag when
displayedOID Operator identificationSP Select by light pen
89. What is the purpose of PUTOVR (Put with explicit override) keyword?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
18/68
AS400TUTORIAL.com Page
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.
90. What is the purpose of OVRDTA (Override Data) keyword?
Use this field level keyword with PUTOVR keyword to override the existing the data contents of a field already on
the display.
91. What is the maximum number of record formats in DSPF?
1024 (One thousand and twenty four)
92. What is the maximum number of fields under a record format of physical file?
8000 (eight thousand)
93. What is the maximum number of parameters allowed in RPG?
255 (Two hundred and fifty five)
94. What is the maximum number of parameters allowed in CLP?
43 (Forty three)
95. What is the maximum number of subroutines allowed in RPG?
254 (Two hundred and fifty four)
96. What is the maximum number of files allowed in RPG?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
19/68
AS400TUTORIAL.com Page
50 (Fifty including eight printer file)
97. What is maximum number of Arrays allowed in RPG?
250 (Two hundred and Fifty )
98. Where can you specify an indicator in LOKUP operation?In 'EQ' position.
99. What is a Member?
It is a subset of data records of a physical file.
100. What is a Physical file?
Physical file nothing but a table contains a only one record format in which we can describe the field definitions an
descriptions.
101. What is a Logical file?
It is nothing but a logical view provided by the physical file.
102. What is Join Logical file?
Join logical file joins more than one file. The maximum of number of files allowed to join is 32 (thirty two).
103. What are the necessary keywords for the Join Logical file?
JDFTVAL, JFILE, JOIN, JFLD, JREF.
104. What is a Non-join logical file?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
20/68
AS400TUTORIAL.com Page
It only provides logical view based on the physical file. This is also called as regular logical file.
105. What is the necessary keyword for Non-join logical file?
PFILE (which is record level keyword)
106. How many levels are there in a Physical file?
Four levels. They are File level, Record level, Field level, Key field level.
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
112. What is the use of JDFTVAL in join logical file?
If you specify JDFTVAL at file level, even the primary file record does not match with secondary file record, the jo
takes place.
113. Is it possible to create a physical file without DDS?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
21/68
AS400TUTORIAL.com Page
Yes. With the help of CRTPF we can achieve this. But we have to give record length.
114. What is a Keyed physical file?
Defining a field as a key in physical file. Hence we can access records through the key field.
115. What is a composite key?
Defining more than one key as a key field in physical file.
116. What is arrival sequence?
The records will be accessed the way in which records are added to physical file.
117. What is the maximum number of key fields allowed defining in a physical file?
120
118. What is acronym of RPG?
Report Program Generator
119. What is the native language of AS/400?
RPG/400
120. Why RPG/400 is famous?
* Easy to code and analyze.* Supports externally described files.
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
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
22/68
AS400TUTORIAL.com Page
122. When do you use F-spec. continuation line ?
* In order to refer the named record format as a subfile record format in the program.* In order to rename the
record format of a database file in a program.* In order to define a named data structure as a file information dat
structure.
123. What are the various types of device files?
Display files, printer files, discket files, tape files etc. ,
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.
125. How do you know that records are locked?
By using a command WRKOBJLCK.
126. What is the purpose of Indicators in RPG?
In order to control the logic flow, we can use indicators in RPG.
127. How do you read data area in an RPG program?
With the help of 'IN' opcode, we can access the data area record in to the program.
128. What are the different types of Data Areas?
The different types of Data Areas are general data area, local data area, group data area, pip (program initializati
parameter data area) data area.*General Data Area - It can be created by user implicitely or explicitlyIt can be
referred by any other jobs.It can be associated with a library.It can be created, deleted by the user.* Local Data
Area - It can not be referred by any other job.It is automatically created and deleted by the system.It is not
associated with any library.*Group Data Area - It is automatically created and deleted by the systemWe can acces
the group data area value through clp.It is meant for group jobs.*Pip Data Area - It is meant for pre start jobs.
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
131. What is term CUA , SAA?Common User AccessSystem Application Architecture
132. Why is AS/400 called Object Oriented Machine?
Everything on the AS/400 System that can be stored and retrieved is contained in the object.
133. What is the version of OS/400 that we have?
V4R2 (Version 4. 0 Release 2. 0)
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
23/68
AS400TUTORIAL.com Page
134. What is DDM ?
Distribution Data Management is a function of the OS/400 that allows an application program or user on one
system to use database files stored on remote system.
135. What is an Object?
An object is any thing that exists in and occupies space in storage and on which operation can be performed.
136. How are the objects stored on AS/400?
All objects are stored on AS/400 in a single level storage. In this method all objects are referenced by one virtual
address which is translated in to a physical address whether it is an auxiliary storage or main memory.
137. What is a Library in AS/400?
A library in AS/400 is an object that serve(acts) as a repository for other objects.138. Name few IBM supplied
libraries?QGPL, QTEMP, QSYS, QUSRTOOL, QCBL, QRPG139. What is library list ?A list that indicates libraries used
for the process and the order in which it has to be searched System identifies it in *LIBL.
140. How many libraries can be there in library list ?
Total 40 (15 system and 25 application)
141. What is Folder?
A Folder is a named object that is used as a directory for documents and other folders.Folders can be filed with in
another folder.
142. What is Spool file, Why is it required?
A file that holds output data to be processed, such as information waiting to be printed.
143. What is Job, What are the attributes of a Job?
A Job is a basic unit of work on AS/400.The attributes are:Job Number Unique system generated sequential
numberJob Name Any user defined name (Max 10 char)User Name Who initiated the job.
144. What is Job description?
A Job description defines an environment in which a batch job or an interactive job to be executed.
145. What is the difference between Interactive & Batch Job?
Interactive Job: A Job started for a person who signon to a workstation.
Batch Job : A predefined group of processing actions submitted to the system to be performed.
146. What is Group Job?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
24/68
AS400TUTORIAL.com Page
A Group Job is attached to one workstation and a user. There should be an initial group job and it can be branche
to many other group jobs. The group jobs can have different library lists and different output, message queues.
Group Job is useful in enhancing the programmers productivity. It is as though logging into the same user-id man
times.
147. What are the two main attributes, which govern the execution of a job?
Run time priority and Time slice
148. What is Sub-System?
Sub-Systems are specific user defined partitions of the CPU where various jobs may be executed. One subsystem
can have more than one active job at a time.
149. What is a Device file?
A device file contains the description of how data is to be presented to a program from a device or vice versa.
Device file can be Printer, Disk, Tape and Remote system.
150. What is an ICF file?
A device file that allows a program on the system to communicate with program in other system.
151. What is a message file?
It is a file which contains the messages of an application. For example all RPG/400 messages are stored in a file, a
COBOL/400 messages are stored in a file.
152. What is a job log?
A record of request submitted to system be a job. The message related to the requests, and action performed by
the system on the log. The system program maintains it.
153. What is the purpose of OPNQRYF (Open Query File)?
OPNQRYF is used to select certain records of the database file based on the QRYSLT (Query select ) condition.
154. How to create files dynamically without DDS?
Through OPNQRYF
155. What command must be executed before executing OPNQRYF command?
OVRDBF (Override Data base file)
156. What is Data Area?
Data area is an object used to hold data for access by any job running on the system. A data area can be locked t
a single user, thus preventing other users from processing at the same time.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
25/68
AS400TUTORIAL.com Page
157. What are the types of data areas?
User defined Data Area, Local Data Area (LDA), Group Data Area (GDA), Program Initialization Parameter (PIP)
Data Area.
158. What is LDA?
LDA is created by the system for each job in the system, including auto-start jobs, jobs started on the system by
reader, and subsystem monitor jobs.
159. What is the type, length of a LDA?
*CHAR, 1024 bytes
160. What is GDA?
The system creates a GDA when an interactive job becomes group jobs. Only one GDA can exists for group.
161. How to create a user defined (general) data area?
Using CRTDTAARA command
162. What are the different ways to input data into data area?
CHGDTAARA (using CL)Using OUT opcode in RPG
163. How to retrieve data from data area?
Using RTVDTAARA command in CL.Using IN opcode in RPG
164. What are the valid user defined data area types?
CHAR, NUMERIC and LOGICAL
165. How can a data area be locked after being updated?
Using OUT *LOCK
166. What is the use of Data Queues?
Data queue is a type of system object that you can create. Data Queues are used in Program to program
communication.
167. How to create a data queues?
Using CRTDTAQ command.
168. What are the valid data types in Data Queue?
Char, Numeric, and Logical
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
26/68
AS400TUTORIAL.com Page
169. What are the two types of read performed on data queues?
Read with lock, and read without lock.
170. How do you use DEBUG utility?
STRDBG program-name UPDPROD(*YES)
171. What is an authorization list?
A lists of two or more user Ids & their authorities for system resources. The system identifies it an object type
*AUTL
172. How do you grant authority?Using GRTOBJAUT command
173. What are the types of object authorities?*USE, *CHANGE, *ADD, *DLT, *READ, *UPD, *ALL, *EXCLUDE,
*OBJEXIST, *OBJMGT, *OBJOPR
174. How do you put jobs in batch mode?
SBMJOB
175. What is the use of OVRDBF ?
You can use the Override with Database file (OVRDBF) command to replace the database file named in a CL
program or to change certain parameters of the existing database file.
176. What is the use of OVRPRTF ?
Override with Printer file (OVRPRTF) command is used to override certain parameters of the printer files used in t
program or to replace the printer file.
177. How to change file attributes such as size, file wait time, record wait time etc. , permanently?
Using CHGPF command
178. What is the use purpose of CRTCMD?
To create user defined command.
179. What is class of service ?
A set of link and node characteristics associated with a session.
180. How to see active jobs of the system.
Using WRKACTJOB command
181. How do you detect unused spool storage?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
27/68
AS400TUTORIAL.com Page
Using Reclaim Spool Storage.
182. What are the functions of Remote Job Entry (RJE) ?
Allows user of AS/400 system to submit jobs and receive jobs from a host system.
183. What is the function of RJE Conversion Utility?
It converts compressed data written to an AS/400 database file to decompressed data written to another AS/400
database, diskette, or device file.
184. What process the command SBMRJEJOB does?
Sends RJE input stream to host system
185. What is journaling & Commitment Control?
Journaling is a function which records the changes in a file in a journal. These record images are used to recover
the changes in the file should the system ends abnormally. Commitment control is a function that allows you to
define and process a number of changes to database files as a single unit (transaction).
186. What is the purpose of STRCMTCTL command?
Starts commitment control for files that are being journalled.
187. What are the system objects required for journalling?
Journal receiver, journal and PFs to be journalled.
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?
For more information
Please visit our website
www.AS400TUTORIAL.com
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
28/68
AS400TUTORIAL.com Page
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
29/68
AS400TUTORIAL.com Page
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.
190. What is an access path?
The order in which the database fields are organized for processing in the program.
191. What are all the different types of access path?
Arrival sequence access path. Keyed sequence access path.
192. What is the default value for the number of increment for the physical file?
Three
193. When does the DFT keyword in PF be used?
To specify the default value it a field.
194. What is Multi-format logical file?
Logical which uses fields from two or more physical files.
195. What is the Select and Omit criteria in logical file?
This is used to specify rules for the Selection/Omission of records from a Physical File.
196. Can fields be concatenated INa logical file level?
Yes. by using CONCAT keyword
197. When would the ALL keyword be used?
Use with Select or Omit, to select/omit records.
199. What are the different types of keywords in display files?
File level, Record format level, Field level
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?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
30/68
AS400TUTORIAL.com Page
The result is same as if you had specified ND.
203. What is the use of DSPATR(MDT) keyword?
Sets on the modified Data Tag of the field. The Data Tag detect whether the field has been changed as a result of
user input.
204. If DSPATR(PC) and CSRLOC were specified for a format, which keyword would have priority?CSRLOC gains
priority.
205. Can error messages as a result of a COMP, RANGE or VALUES keyword be overridden?
Yes, through CHKMSGID keyword.
206. What the purpose of OVRDTA, OVRATA keywords?
OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record
already on the display.OVRATA keyword (field or record level) can be used to override the existing display
attributes of a field or record already on the display.
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.
209. What is the purpose of the INDARA keyword?
This File-level keyword is used to remove option and response indicators from the buffer and places them in 99-
byte separate indicator area.
210. Explain the purpose of KEEP and ASSUME keywords?
KEEP: Keep the display from being deleted when the display file is closed.ASSUME: It is used to specify that the
OS/400 program is to assume that this record is already shown on the displaywhen this file is opened.
211. Explain the use of DFTWRT display keyword?
No records will be displayed until there is any I/O operation.
212. What is the purpose of FRCDTA keyword ?
Immediately display a record format without waiting for the next I/O operation.
213. What keyword must be used with PROTECT keyword?
OVERLAY
214. What is Subfile?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
31/68
AS400TUTORIAL.com Page
Subfile is group of records of same record format and can be read from or write to the display in a single operatio
215. What are all the contents of subfile?
Subfile Record Format, Subfile Control Record Format, Relative Record Number, Subfile Record Number, Associate
Subfile Keywords.
216. What are the two record formats a subfile contain ?
Subfile record forma (SFL), and subfile control record forma (SFLCTL).
217. What is SFLPAG and SFLSIZ ?
SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen.SFLSIZ : it is a
attribute which specifies the number of records can be stored in subfile.
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 is24
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.
222. How do you specify the number of records to roll in a subfile?
Use SFLROLVAL keyword in DDS along with number, which specifies the number of records to scroll at a time.
223. How will you display a particular page in subfile?
Move a valid relative record number (RRN) in the field specified using SFLRCDNBR keyword in DDS.
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.
225. What is the use of SFLEND keyword?
By specifying this keyword, the Bottom/More message could be displayed at end of screen.226. How to toggle
between single line and Multi - line display of a particular record in a subfile?Using SFLDROP keyword.
227. Explain the difference between defining Subfile and Message-subfile?
Subfile record is defined by SFL keyword, where as Message subfile is defined by SFLMSG keyword.
228. What are the different types of variables available in CL?DEC, CHAR, LGL
229. How do you pass parameters in CL?
Using PARM keyword.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
32/68
AS400TUTORIAL.com Page
230. What is difference between CAT, TCAT, BCAT?
CAT Concatenate two variables or constants into one continuous string.BCAT Truncates all trailing blanks in the fir
character string, one blank is inserted, then the two character stringsare concatenated.TCAT Truncates all trailing
blanks in the first character string, the two character stringsare concatenated.
231. What are the different types of messages in CL?
Immediate message, Break message, Program message, User message
232. How to trap errors in CL?By using Monitor Message Command (MONMSG)
233. What is the maximum length of a variable name in CL?
Maximum 11 characters (including '&')
234. What are the limitations of CL (compare to RPG) ?
you can not use CL program to ADD or UPDATE records in database files.Use Printer or ICF files.Use Program
described files.Use the concept of subfile (to display more than one record), but a single output message subfile is
a special type ofsubfile that is supported well in CL.Use subroutines.You cannot declare more than one object (file
in a CL programme.
235. What is the use of Header Specification in RPG/400?
It identifies by H in column 6, provides informaion about generating and running programs.
236. When will DUMP and DEBUG opcodes be ignored?
If blank is specified in position 15 of H specs.
237. Specify different indicators used in RPG?
Overflow indicatorsRecord Identifying IndicatorsField IndicatorsResulting IndicatorsControl Level Indicators
237. What are Control level indicators?
L1 to L9 used to identify certain fields on control fields and then used to condition which operations are to be
processed at detail or total calculation or output time.
238. What is the use of E specification in RPG?
Extension Specs describes all record address files, arrays and tables.
239. What is the use of L specs in RPG?
Line counter specification can be used to describe printer file to indicate the length of the form and number of line
per page.
240. In which specification the report layout can be defined?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
33/68
AS400TUTORIAL.com Page
O Specification.
241. How many files can be defined in F specs?
50
242. How many printer files can be defined in F specs ?
8
243. Give three main purposes of File specification ?
To define files, to describe the files, to assign the files to specified devices.
244. How do you specify page overflow indicator for printer files in RPG?
Specify an indicator in position 33-34 of F specification.
245. What is a Primary File?
It is used in RPG Program Cycle to automatically read records in a cycle.
246. Can a indexed file be accessed in arrival sequence in RPG program?
Yes.
247. What is a Program Described file in RPG?
The field name and length of the fields are defined with in the RPG program.
248. What is externally described file ?
All information about the fields is specified in DDS and the RPG program can use them with in the program.
249. Can you specify a display file to be used in the following modes Input, Output, or Combined modes ?Yes.
250. What is match field indicator?
Matching record indicator is seton when all the matching fields in the record of a secondary file matches with all t
matching fields of a record in a primary file.
251. What is the length of a variable in RPG?
6 Characters.
252. When is a TAG statement used in RPG?
It is used as Label.
253. What opcode could be used to test an alphanumeric field for all numeric values?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
34/68
AS400TUTORIAL.com Page
TESTN
254. What opcode will be used to test the zone of a character field?
TESTZ
255. How to read database records without locking them?
Put 'N' in position 53 of C specs.
256. What does CHECK opcode is used?
The check operation verifies that each character in the base string (factor 2) is among the character indicated in
the comparator string (factor 1).
257. What does 'SR' in columns 7-8 of C specs mean?
Calculation operation is a part of RPG subroutine.
258. What is SCAN and XLATE?SCAN operation scans a character string (base string) contained in factor 2 for a
substring (compare string ) contained in factor 1.XLATE operation translates characters in source string (factor 2 )
to the from and to strings (factor 1 ) and put into the result field.
259. How do you use commitment control in RPG program ?
Using COMIT operation. Makes all changes to the files that have been specified in output operation since the
previous COMIT or the begining of operations under commitment control(if there has been no previous COMIT or
ROLBK operation).
260. How do you use exceptional write in C specs?
Using EXCPT opcode.
261. What does the opcode FREE do?
The FREE operation removes a program from the list of activated programs, frees static storage and ensures
program initialization (first cycle processing) the next time program is called. It does not close file or unlock data
area.
262. What does opcode POST do?Puts information in INFDS.
For more information
Please visit our website
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
35/68
AS400TUTORIAL.com Page
www.AS400TUTORIAL.com
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
36/68
AS400TUTORIAL.com Page
263. What is the maximum number of elements in an array?
9999
264. Can we define Multi-dimensional arrays in RPG?
No.
265. What is XFOOT opcode?
Adds all the elements in a numeric array, and places the sum in the result field.
266. How can we sort an array?
By using SORTA opcode.
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.
268 How many parameters can be defined in a RPG program. ?
255
269. What is File Information Data Structure?
File Information Data structure (INFDS) can be defined for each file to make file exception/error information
available to the program. A file information data structure contains predefined subfields that identify: the name of
the file for which the exception/error occurred. the record being processed when the exception/error occurred or
the record that caused the exception/error. The last operation being processed when the exception/error
occurred.The status code. The RPG routine in which the exception/error occurred.
270. What is Program Status Data Structure?
A Program status DS can defined to make program exception/error information available to an RPG program.DS is
defined as program status DS by an S in position 18 of the DS statement.*STATUS contains status code.*ROUTIN
: contains name of routine in which the exception/error occurred*PARMS : contains the number parameters passe
to this program from the calling program
.271. What is the maximum number of times Multiple Occurrences DS can occur in a program?
9999
272. What are all the compiler directive statements?
/TITLE, /SPACE, /EJECT, /COPY
273. What is SAA?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
37/68
AS400TUTORIAL.com Page
Systems Application Architecture (SAA) is a collection of selected software interfaces, conventions, and protocols
that will provide a consistent framework across the System/370, AS/400 and PS/2.
274. During execution, an RPG/400 program automatically follows a sequence of operations for each record that i
processed. The built-in program cycle includes the following logical steps.1. reading input (READ)2. processing
calculations (PROCESS)3. writing output
(WRITE)******************************************************************************275.
What is the Function of PDM?
Productivity tool for copying, deleting, scanning, changing & creating source files.
276. What is the function of SEU ?
A utility for editing programming language source code.
277. What is the use of SDA ?
Screen Design Aid is used to create display files interactively.
278. What is a library in AS/400 ?
Library in AS/400 is an object that serves as a repository for other objects
.279. Name few IBM supplied libraries ?
GPL, QTEMP, QUSRTOOL, QSYS, QRPG & QCBL.
280. What is a library list ?
Library list that indicates libraries used for the process and the order in which it has to besearched. System
identifies it in *LIBL.
281. How many libraries can be there in a library list ?
Total 40 (15 system and 25 application).DDS - Data Description Specification.Source Physical File contains the
source for the various objects created. This file has a specific structure.RPG, CLP, DSPF, PRTF, etc.A-specUNIQUE
PFILE, REFFLD
282. What is the difference between Physical and Logical files ?
Physical file contains data, where as Logical file serves as a access path to database.
283. What does the keyword UNIQUE mean ?
Records with duplicate key values are not allowed.
284. What is FCFO, FIFO, LIFO in Database environment ?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
38/68
AS400TUTORIAL.com Page
These are file level keywords which are used to access the records in the orderFCFO : First Changed First OutFIFO
First In First OutLIFO : Last In Fist Out
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.
286. What is Multi-format logical file ?
Logical which uses fields from two or more physical files.
287. What is keyword PFILE specifies ?
PFILE is used define the Physical file being referenced.
288. What is a Join Logical File, Can it be used for Update ?
Logical file that combines more than one physical file.Update is not possible through JLF.
289. Is it possible to join the same file to itself ?
Yes
.290. What does SDA stands for ?
Screen Design Aid.
291. What is the symbol used for defining a new field in SDA?'
+'.292. What is the symbol used for shifting fields in SDA?
''.
293. What is the symbol used for copying & moving new field in SDA?
Copying : '-' & '=='.Moving : '-' & '='.
294. What is the symbol used to get name & length of a field in SDA?
'?' .*DATE, *TIME.
295. How can a screen field that has changed since the last output operation be detected ?
Attach the MDT attribute to the field, to detect whether field has been changed as a result of user input
.296. What would be the effect on the field where reverse image, underline and highlight display attributes are
active ?
The result is same as if you had specified ND.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
39/68
AS400TUTORIAL.com Page
297. What is the purpose of OVRDTA and OVRATA keywords ?
OVRDTA keyword (field or record level) can be used to override the existing data contents of a field or record
already on the display.OVRATA keyword (field or record level) can be used to override the existing display
attributes of a field or record already on the display.
298. What keyword must be used with PROTECT keyword ?OVERLAY
299. What is RPG ?Report Program Generator.
300. What are the different types of specification available in RPG/400 ?
Control Spec.( H )File Spec.( F )Extension Spec.( E )Line counter Spec.( L )Input Spec.( I )Calculation Spec.( C
)Output Spec.( O )
301. Is it necessary to define all formats ?
Which are mandatory and which are Optional ?
No, all are Optional.
302. What is the use of E specification in RPG ?
Extension Specs describes all record address files, arrays and tables
.303. In which specification can a report layout be defined ?
O Specification.
304. How many files can be defined in F specs ?
A maximum of 50 files.
305. Can an indexed file be accessed in arrival seQuence in RPG program ?
Yes.
306. In which specification Data Structures can be defined?
I - Spec
.307. When is a TAG statement used in RPG ?
It is used as a Label.
308. What are the different Opcodes available in RPG for Database access ?
READ, CHAIN, WRITE, UPDAT, DELET, SETLL, SETGT, READE, READP, REDPE, OPEN, CLOSE, FORCE, NEXT,
UNLCK.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
40/68
AS400TUTORIAL.com Page
309. How can database records be read without lock ?
Put 'N' in position 53 of C specs.310. What does CHECK opcode do ?
The check operation verifies that each character in the base string (factor 2) is among the ` character indicated in
the comparator string(factor 1).
311. In conjunction with which statements can ORxx and ANDxx conditions be used ?
DOUxx, DOWxx, IFxx, and WHxx.
312. What does opcode POST do ?
Puts information in INFDS.313. Can you have multiple key lists for a single file ?
Yes.
314. What are the different types of arrays available in RPG ?
Pre-execution time array.Compile time array.Execution time array.
315. Can we define Multi-dimensional arrays in RPG ?
No.
316. What is XFOOT opcode ?
Adds all the elements in a numeric array, and places the sum in the result field.
317. During input operation which indicator position is seton if there is a record lock?
LO indicator position is seton
.318. What is the difference between *LIKE and *NAMVAR ?
*LIKE defines the variables as in database.*NAMVAR is used to define variables as data area.
319. Where will control be passed after the execution of the *PSSR subroutine if the factor2 of the ENDSR is blan
?Control will return to the next sequential instruction.
320. What is the maximum number of subfiles that can specified in a display file ?
512The maximum number of subfiles that can defined in a RPG program for one display file is ___ .24
321. The maximum number of subfiles that can be active for a single file is ____ .12
322. What are the different opcodes used for file operation on a subfile in a RPG pgm?
READ, READC, CHAIN,UPDAT and WRITE
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
41/68
AS400TUTORIAL.com Page
323. How will you display a particular page in subfile ?
Move a valid relative record number(RRN) in the field specified using SFLRCDNBR keyword in DDS.
324. Can a single screen format occupy a screen area above and below a subfile format ?
Not possible.
325. What is SFLPAG and SFLSIZ ?
SFLPAG : it is an attribute which specifies the number of records that can be displayed in a screen.SFLSIZ : it is a
attribute which specifies the number of records can be stored in the subfile
.326. 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.
327. How do you specify the number of records to roll in a subfile ?
Use SFLROLVAL keyword in DDS along with the number, which specifies the number of records to scroll at a time
.328. What are the three line types in RLU ?
Report line, Filler line & Sample line.
329. What is the function of RLU ?
To design & prototype a report.
330. What are the three types of keywords associated with printer file ?
File level, Record level & Field level.
331. How do you combine two record formats in RLU ?
Using CLC.19.
332. What are the different commands used in RLU ?
DR - Define Record, CLC - Change Line for Continuation, CLR - Change Line for Record, SD - Create Sample Data,
VF - View Fields, NP - New Page, DC - Define Constants, DF - Define Fields, CF - Centre Fields & SP - Space Fields
evenly
.333. What is the command used to invoke RLU ?
STRRLU.
334. What are different record spacing keywords in RLU ?
SKIPA, SKIPB, SPACEA & SPACEB.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
42/68
AS400TUTORIAL.com Page
335. Mandatory keywords of sub fileSFL, SFLCTL, SFLDSP, SFLSIZ, SFLPAG are the mandatory key words
336. Difference between SFLRCDNBR and SFLNXTCHGSFLRCDNBR will give the RRN of the First record displayed
on the screen at a given time.Whenever a record is changed on display file. An MDT is set ON. If an indicator is
associated with SLFNXTCHG and it is SETON then READC will read only the changed record. And if the indicator is
not associated and it is seton it READC reads all the records from sub-file
337. How can see logical file based on which physical file and vice versa
DSPDBR
338. How can u check no of records in a file
DSPFD
339. How do u compile RPGLE program
Either thru 15 or crtrpgmod
340. Is module executable
No You need to create an RPG prog to run the module
341. What is procedure?
A procedure is the set of self-contained high level language statements that can perform a particular task and the
returns to a caller
342. What is service program?
A Service Program is a collection of runnable procedures and available data items easily accessible by other ILE
programs. In many respects it is similar to a subroutine library and procedure library.A service program differs fro
a program in two ways: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
343. What is LOKUP opcode?
Looks for a particular element of an array
344. How many files, printer files you can describe in a RPG50 files and 8 printers
345. How do handle file exception/error*INFDS ,*PSSR defining it in F spec
346. What is OPNQRYF, MONMSG commandsIt is Dynamically creation of access path, and it can have resultant
fields i.e. if the expression is A = B + C then B and C are from the file while A is defined in OPNQRYF. We can
divert the output of command to an OUTFILE. Command associated with OPNQRYF is CPYFRMQRYF to save the
output permanentlyIt is a CL command to monitor and error/exception message so that in case of an error a dum
is avoided and the control is in program. It is also used to monitor user message.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
43/68
AS400TUTORIAL.com Page
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 mentioningCLOSE in opcode of C spec.
349. Distinguish between terminating a program through SETON LR and RETURN?LR closes all the files used in th
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
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 subfil
page size it is called non-elastic subfile.
360. What is SFLINZ and SFLRNA?
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
44/68
AS400TUTORIAL.com Page
SFLINZ stands for subfile initialize. It initialized all the character field as blanks and numeric fields aszeros. SFLRN
stands for subfile record not active (It means records are there in the subfile butactive).
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 yo
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?I
t 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.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
45/68
AS400TUTORIAL.com Page
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
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
46/68
AS400TUTORIAL.com Page
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 activejobs are seen.
391. What are the three levels of SDA?
File level, Record level, Field level.
392. What is *PSSR?I
t 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?
For more information
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
47/68
AS400TUTORIAL.com Page
Please visit our website
www.AS400TUTORIAL.com
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
48/68
AS400TUTORIAL.com Page
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 b
defined?File Level
405. Write down any two mandatory keywords used when defining a subfile?SFLDSP, SFLDSPCTL, SFLCTL, SFLSI
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 shoul
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 an
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
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
49/68
AS400TUTORIAL.com Page
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 jobs 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 containsmembers, 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/SRCPhysical File: - *PF/DTA
428. Whats 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 QualifierVerb: - actionObject: - on which action is
performedQualifier: - 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 file
& 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)
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
50/68
AS400TUTORIAL.com Page
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 PFs, with the PFs 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 sid
the line number.
445. What are the different methods to access SEU?Use the Start Source Entry Utility command (STRSEU)Option
from STRPGMMNUThrough 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 OOG & 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 ne
page while Space before leaves the specified no. of lines on that page.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
51/68
AS400TUTORIAL.com 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 PLISTPARM
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 severa
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 straig
away passes onto this subroutine
.468. Types of Tables in RPG?There are 2 types of tables in RPG they are: - Compile Time TablesPre-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 witho
human intervention or control whileInteractive 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?1024476.
What does VLDCMDKEY means?Valid Command Key.
477. What is the error if we dont 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.
480. Types of Data Structures?a. File Information Data Structure.b. Program Status Data Structure.c. User Define
Data Structure.d. Multiple Occurrence Data Structure.e. Date Area Data Structure.481. What is Subfile?A Subfile is
temporary area in memory which records may written to & read from a display file device.
8/3/2019 com AS400 Tutorial and FAQs_4e92242b163f4
52/68
AS400TUTORIAL.com Page
482. Which is the subsystem that is always on till the main power switch is off?QCTL
483. What is the command to shutdown the As/400 Server?PWRDWNSYS & Parameter *IMMED.
484. How can we know the CPU utilization of the server?WRKACTJOB (Work with active job)WRKSYSSTS (Work
with system status)
485. Which are the libraries (system) always present in the library list?QTEMP & QGPL
486. Which users are allowed to manipulate system libraries?QSECOFR & QSYSOPR487. 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 PFs?In fixed length records.490. Give an example of DEFN opcode?*LIKE DEFN ENAM
$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 th
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?*