As400 Questions
As400 Questions
Ans: Application system.
2. What is ‘LPAR’?
Ans: When we execute a command or call a program, the AS/400 must know where to find the
command or program and the answer is library. A Library is a collection of objects. QSYS is the only
library that contains other library. QSYS is the root library where the entire user defined/ system
defined library is created. System supplied libraries begin with the letter "Q" or "#".
System library: All IBM supplied library e.g. QSYS, QHLPSYS, QUSRSYS…
Product Library: Whenever Ibm product is used it is added to the library automatically and is
removed itself when the job completes.
Current Library: Current library is the working library i.e. all the work done by you is stored in
current library.
User Library: Non-IBM supplied i.e. created by the user.
For more information related to library and library commands: Click here...
4. Which library gets first loaded into the system when we login?
Ans: QSYS
In many cases, when you do not specify a library while creating object, then system will create object
in QGPL. e.g.
After running above command, OUT11111 will be placed in QGPL as we mentioned *LIBL in library
which is not specific. Hence system uses this general purpose library QGPL. Hence, this General
purpose library is used by System as well as by users.
But, it is always advised to use your personal library instead of using QGPL.
6. How can we see all the objects and its sizes in a library?
Display Library
Bottom
F3=Exit F12=Cancel F17=Top F18=Bottom
Ans: Source physical file is a file which contains the sources of different types of objects. There can
be up to 32768 members. Source physical file is an object. But the source member is not an object.
When we compile the member, the object is created for that source. Command used is CRTSRCPF.
Member size:
Ans: For this we will use file level keywords FIFO/LIFO/FCFO in the physical file.
FIFO: The duplicate key records 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.
12. How to refer another file to define a new field in a physical file?
Ans: below is an example, we are going to use the file REFER to get the field definition
for new file.
USE OF REFERENCE
Columns . . . : 1 71 Browse
AMINEM/DDSSRC
SEU==>
REFER
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions+++++++++++++++
+++
*************** Beginning of data
*************************************
0002.00 A R REF
0003.00 A RAC1 2P 0 COLHDG('LEVEL ID')
0004.00 A RAC2 3P 0 COLHDG('ORG CODE')
0005.00 A RAC3 12P 0 COLHDG('ACCOUNT NUM')
0006.00 A RAC4 3A COLHDG('ACCOUNT
CURRENCY')
0007.00 A RPOSTCODE 2P 0 COLHDG('POST CODE')
0008.00 A RCOUNTRY 3P 0 COLHDG('COUNTRY CODE')
0009.00 A RNAME 20A COLHDG('NAME')
0010.00 A RDATE 3P 0 COLHDG('DATE')
****************** End of data
****************************************
Now we can refer the file ‘REFER’ to take the field definition in the new file.
Columns . . . : 1 71 Browse
AMINEM/DDSSRC
SEU==>
USEREF
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions+++++++++++++++
+++
*************** Beginning of data *************************************
0002.00 A REF(REFER)
0003.00 A R USEREF
0004.00 A ACCLVL R REFFLD(RAC1 REFER)
>>>>>> field name and
0005.00 ALIAS(ACC_LVL_ID)
referred file name
0007.00 A ACCORG R REFFLD(RAC2 REFER)
0008.00 ALIAS(ACC_ORG_CODE)
0009.00 A ACCNUM R REFFLD(RAC3 REFER)
0010.00 ALIAS(ACC_NUM)
0011.00 A ACCCUR R REFFLD(RAC4 REFER)
0012.00 ALIAS(ACC_CUR)
0013.00 A ACCNAME R REFFLD(RNAME REFER)
0014.00 ALIAS(ACC_NAME)
Ans: It depends on the value that we have set for LVLCHK (Record format level check) attribute. If
its value is *YES then the record format level identifier is checked when the file is opened and if it
doesn’t match it throws the error. If its value is *NO, then the record format level identifier is not
checked, hence no error.