Thursday, September 27, 2007

AS/400 F.A.Q's




DB2/400 & CL/400

1. How do you find physical file for a logical file?
By using DSPFD command and PFILE
2. What is use of RGZPFM? (Reorganize Physical File Member)
Remove deleted records to make the space occupied by them available for more records.

Reorganize the records of a file in the order in which you normally access them sequentially, there by minimizing the time required to retrieve records. This is done using the KEYFILE parameter.

This may be advantageous for files that are primarily accessed in an order other than arrival sequence. A member
can be reorganized using either of the following:
– Key fields of the physical file
– Key fields of a logical file based on the physical file

Reorganize a source file member, insert new source sequence numbers, and reset the source date fields (using the SRCOPT and SRCSEQ parameters on the Reorganize Physical File Member command).

Reclaim space in the variable portion of the file that was previously used by variable-length fields in the physical file format and that has now become fragmented

3. What is ODP in AS/400?
An open data path is the path through which all input/output operations
for the file are performed. In a sense, it connects the program to a file. If you do not specify the SHARE(*YES) parameter, a new open data path is created every time a file is opened. If an active file is opened more than once in the same job or activation group, you can use the active ODP for the file with the current open of the file. You do not have to create a new open data path.

4. Can you tell about the access path maintenance (*Immediate, *Rebuild, *Delay)?
The MAINT parameter specifies how access paths are maintained for closed files. While a file is open, the system maintains the access paths as changes are made to the data in the file.

Immediate maintenance of an access path means that the access path is maintained as changes are made to its associated data, regardless if the file is open. Access paths used by referential constraints will always be in immediate maintenance.

Rebuild maintenance of an access path means that the access path is only maintained while the file is open, not when the file is closed; the access path is rebuilt when the file is opened the next time. When a file with rebuild maintenance is closed, the system stops maintaining the access path. When the file is opened again, the access path is totally rebuilt. If one or more programs has opened a specific file member with rebuild maintenance specified, the system maintains the access path for that member until
the last user closes the file member.

Delayed maintenance of an access path means that any maintenance for the access path is done after the file member is opened the next time and while it remains open. However, the access path is not rebuilt as it is with rebuild maintenance. Updates to the access path are collected from the time the member is closed until it is opened again. When it is opened, only the collected changes are merged into the access path.


5. How do you update a file in a CL program?
By using RUNSQLSTM Command
6. What will be your approach in going either for OPNQRYF or Logical files?
7. What is a JOB?
Is a Unit of work or any piece of work within the business is considered a job
8. How to lock a file in CL?
Using ALCOBJ command
9. What is a MONMSG?
Using the Monitor Message (MONMSG) command, you can direct a procedure to
Take predetermined action if specific errors occur during the processing of the
Immediately preceding command. The MONMSG command is used to monitor for
Escape, notify, or status messages sent to the call stack of the procedure in which
The MONMSG command is used.

No comments: