Top AS400 Interview Questions
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
What Is A Library In As/400?
A library in AS/400 is an object that serve(acts) as a repository for other objects.
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.
How Many Libraries Can Be There In Library List?
Total 40 (15 system and 25 application).
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 or equal to key or relative record number specified in factor1.
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.
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.
Define A Job Queue?
Job queues are queues of batch jobs waiting to be processed.
What Is Compiler Directive In As400? Give Example Of Compiler Directive.
Compiler directive :
Compiler directive is an instruction (directive) given to the compiler, to perform some specific task during compilation or to generate customize compiler listing report after compilation.
Compiler directive serve many purposes like it is used to control the heading information in compiler listing, to control the spacing of the compiler listing, to include source statement from other source member, to do a free form calculation in our rpgle program, to control the source records selection/omission based on some condition etc.
Compiler directives are:
/FREE… /END-FREE
/TITLE
/EJECT
/SPACE
/COPY or /INCLUDE
/IF……/ELSEIF…. /ELSE…… /ENDIF
/EOF
How Can We Create Subsystem In As400?
Steps of creating the subsystem :
Create Subsystem description (CRTSBSD) :
First of all we create subsystem description as below:
CRTSBSD SBSD (AMINEM/MYSBSD) POOLS ((2 *BASE)) MAXJOBS(2) TEXT(‘My subsystem description’)
Here, the subsystem job will run in pool 2 and will use *BASE for main memory storage. There can maximum of 2 jobs inside the subsystem at a time.
Create Job queue (CRTJOBQ) :
Then we create a job queue as below:
CRTJOBQ JOBQ (AMINEM/MYJOBQ) TEXT(‘My job queue’)
Add Job Queue Entry (ADDJOBQE) :
Once the job queue is created, then we attach the (ADDJOBQE) command, as follows:
ADDJOBQE SBSD (AMINEM/MYSBSD) JOBQ (AMINEM/MYJOBQ) MAXACT (1)
MAXACT denotes the number of the jobs that can be process at the same time.
Create Class (CRTCLS)
Class defines the run time attribute e.g. Run priority, Time slice, Default wait time, Maximum temporary storage etc.
CRTCLS CLS(AMINEM/MYCLS) RUNPTY(40)
Add Routing Entry (ADDRTGE)
ADDRTGE SBSD(AMINEM/MYSBSD) SEQNBR(9999) CMPVAL(*ANY) PGM(SYS/QCMD) CLS(AMINEM/MYCLS)
Start Subsystem (STRSBS)
STRSBS SBSD(AMINEM/MYSBSD)
Once the subsystem is started it can be used to submit the job.
What Is File Information Data Structure(infds) In As400?
A file information data structure (INFDS) can be defined for each file to make file exception/error and file feedback information available to the program.
What Is Program Status Data Structure(psds) In As400?
A program status data structure (PSDS) can be defined to make program exception/error information available to the program so that the necessary action can be taken for the unhandled exception.
The exception /errors can beDivide by zero, array index out-of-bound, Invalid Date, Time or Timestamp value. The PSDS must be defined in the main source section; therefore, there is only one PSDS per module.
What Are The Types Of Data Structure In As400?
Below are the types of data structures in as/400:
PROGRAM DESCRIBED DATA STRUCTURE
EXTERNALLY DESCRIBED DATASTRUCTURE
MULTIPLE OCCURENCE DATASTRUCTURE
INDICATOR DATA STRUCTURE
DATA AREA DATA STRUCTURE (SPECIFIED IN ‘U’)
PROGRAMME STATUS DATASTRUCTURE (SPECIFIED IN ‘S’)
FILE INFORMATION DATASTRUCTURE
What Is Data Structure In As400? What Is The Use Of Data Structure?
DATA STRUCTURE :
Data structure in general means a structure of different data type.
Data structure is specified in the Input Specification of an RPG 3 Program whereas in RPG 1V we specify it in ‘D’ specification.
Data Structure is used-
To break fields into subfields
To Group fields
To change the format of the field
To Group non-contiguous data into contiguous format
To convert data.
What Is Array In As400? What Are The Types Of Array?
Array is collection of elements of same data type.
Types of Array
Compile time array
Pre-runtime array
Run time array
What Is The Difference Between Physical File And Logical File?
Physical file
Occupies the portion of memory. It’s containing data.
A physical file contains one record format
Can be exist even without LF
If you delete a LF, the PF can’t be deleted
CRTPF command is used to create such object
Logical file
Does not occupy any memory space. Does not contain any data.
A logical file can contain up to 32 record formats.
Can’t exist without PF
If you delete a LF, the PF can’t be deleted
CRTLF command is used to create such type object
What Is The Difference Between Non-join Logical Files And Join Logical Files?
Non join logical file:
We can insert or delete or update records using non-logical file.
DFU can be used to display non-join logical file.
1-32 record format is specified
Commitment control is used
Join logical file:
Insertion, updating or deletion of records is not possible in join logical files.
DFU is not available
Only one record format can be specified
Commitment control cannot be used.
What Is Access Path In As400?
Access path
Access path describes the order in which records are to be read.
Access paths can be kept on the system permanently (such as physical or logical file) or temporarily.
OPNQRYF command may create a temporary access path for use one time, and then discard the access path.
What Is The Difference Between Crtdupobj And Copyf?
In CRTDUPOBJ for a logical file the created duplicate file will be also logical file and for a physical file the created file will also be a physical file. Even the record format identifier will also be the same. While in case of COPYF, if we are copying a logical file then the created file be a physical file not a logical file.
What Are The Record Format Field Mapping Options In Cpyf?
Record format field mapping (FMT)
MAP :
Fields with the same name in the from-file and to-file record formats are copied, and any fields in the to-file that do not exist in the from-file format are set to the default value specified on the DFT keyword for the data description specification (DDS) of the to-file or zero for numeric fields, blanks for character fields, current date/time for date/time fields, or null value for null-capable fields.
If *MAP is specified, *DROP can also be specified.
DROP :
This value must be specified for field-level mapping if any of the field names in the from-file record format do not exist in the to-file format. If *DROP is specified, *MAP can also be specified.
When *DROP is specified, all the field names that exist in both record formats must have the same attributes and relative positions in the from-file and to-file record formats, or *MAP must also be specified. Null values are copied.
NOCHK :
If the record formats of the database files are different, the copy operation continues despite the differences. Record data is copied directly (left to right) from one file to the other. FMTOPT (*NOCHK) is required when copying all record formats from a logical file with multiple formats (when RCDFMT (*ALL) is specified) to a physical file that is of the same type (source or data) as the from-file.
CVTSRC :
This value is used to copy between database files, from a source file to a data file, or from a data file to a source file. It is valid only when the from-file and to-file are different types (source and data).
What Is The Default Access Path Of A File?
If you do not specify the type of maintenance for a file, the default is immediate maintenance.
What Is Logical File In As400? What Are The Types Of Logical File?
Logical file :
Logical file does not occupy any memory.
One or more logical file can be derived from a single physical file.
It simply contains the record selection definition and when accessed retrieves the records from the physical file to which it refers.
A logical file can contain up to 32 record formats.
It selects records dynamically. It cannot exist without a physical file.
We can filter the data with criteria by using select and omit command.
A logical file does not contain any data but provides the ‘VIEWS’ of the data to satisfy end-user’s needs.
Types of Logical file :
There are two types.
Non-join logical file
Join logical file
What Is Dynslt?
DYNSLT:
Use this file-level keyword to indicate that the selection and omission tests specified in the file (using select/omit specifications) are done at processing time. This keyword specifies dynamic select/omit rather than access path select/omit.
Only a Physical file contains data. Logical files just contain pointers for processing the data in a specific sequence and/or subset of data.
When a record is added/changed/deleted in a physical file, the system has to put a lock on it and then go out to check and update any logical files before it can release the lock. While the amount of time to do this is hardly measurable, it can be significant if massive batch updates are done to a file.
If you are using the Select/Omit option in your DDS and using DYNSLT, the above process does not need to be done at record update time.
Where this is beneficial is when your selection process includes almost all the records in the file. Now when you process using DYNSLT, it will read all the records in the file, but do the selection of which records to process at that time rather than having done all the maintenance ahead of time.
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).
What Is The Use Of Jdftval In As400?
When this file-level keyword is used the system provides default values for all for fields when a join to a secondary file does not produce any records.
If this keyword is not specified a record in the primary file for which there is no corresponding record in the secondary file is skipped.
Can Level Check Error Occur If We Do Chgpf?
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.
How Can We Arrange Duplicate Records In A File?
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.