• No results found

Record format level identifier check at program run-time If the file level-identifiers did not match (in step 4), then the system checks the record format level-identifiers Each one stored in the program is checked against the corresponding level-identifier in the

In document As400 Interview Questions (Page 113-116)

root of the expression or

5. Record format level identifier check at program run-time If the file level-identifiers did not match (in step 4), then the system checks the record format level-identifiers Each one stored in the program is checked against the corresponding level-identifier in the

file. If a mismatch is found, the program gets a "record format level check" escape message. To correct the problem you need to recompile the program.

How to turn off level checking

You can turn level checking off for a file when you create the file. For example, the Create Physical File (CRTPF) command and the Create Logical File (CRTLF) command both have a Level check parameter (LVLCHK) that allows you to control level checking. When you use the default *YES, the system will go through the level checking process describe above. Specify *NO and the system will completely bypass the run- time level checks whenever the file is opened.

You can also control level checking at run time using the Override Database File (OVRDBF) command. It, too, has a Level check parameter that allows you to turn level checking off temporarily. Do this by specifying

*NO for this parameter. Note, however, that you cannot specify *YES for this parameter, so you cannot turn on level checking at run time for a file created with LVLCHK(*NO).

10) Describe exception handling

CLP

11) How to read a database file in a CL program 12) How to check for end of file

Ans:- CPF0864

13) Can I use an override to position in a database file 14) Display a record format in CL program

15) How to submit a program in batch 16) How do you debug an RPG program. 17) Three ways of copying a file.

• CRTDUPOBJ

• CPYF

• INSERT INTO

I have a program object I need to identify the location of the source DSPOBJD OBJ (XXXX) (*SERVICE)

How to check an object exists on the system in a CL program. How to display record locks

2) How to get the length of data in a variable? Not the length of variable. 3) How to use TEST opcode for a alphanumeric variable?

4) Why use LF with key and not PF with key if no maintenance considerations. 5) What’s FIFO?

6) Can u have a PF with fields derived from 2 field reference files?

7) Can u have an LF defined on all the members of a PF at once? If so how? 8) How do u know when a Batch Job has ended?

9) How will u use a pgm to change current library list?

10) How will u use a pgm to change library list for an interactive job after a batch job?

11) What are job

12) Difference between activation group and job ?

13) What are the types of activation group and their significance?

14) What are modules, service programs, can u see the code of service pgms if u

browse through them?

15) How is ILE different from other HLL’s?

16) What is difference between *SRVPGM and a normal RPGLE pgm both can

have modules. Why prefer *SRVPGM?

17) Service programs are mare by pass by reference?

18) What are the types of access path maintenance? Explain each of them.

Specify the current access path maintenance (MAINT) parameter

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. However, because more than one access path can exist for the same data, changing data in one file might cause changes to be made in access paths for other files that are not currently open (in use). The three ways of maintaining access paths of closed files are:

• 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.

If you do not specify the type of maintenance for a file, the default is immediate maintenance.

MAINT parameter comparison

Table 2 compares immediate, rebuild, and delayed maintenance as they affect opening and processing files.

Table 2. MAINT Values

Function Immediate Maintenance Rebuild Maintenance Delayed Maintenance Open Fast open because the access path

is current.

Slow open because access path must be rebuilt.

Moderately fast open because the access path does not have to be rebuilt, but it must still be changed. Slow open if extensive changes are needed.

Process Slower update/output operations when many access paths with immediate maintenance are built over changing data (the system must maintain the access paths).

Faster update/output operations when many access paths with rebuild maintenance are built over changing data and are not open (the system does not have to maintain the access paths).

Moderately fast update/output operations when many access paths with delayed maintenance are built over changing data and are not open, (the system records the changes, but the access path itself is not maintained). Note:

1. Delayed or rebuild maintenance cannot be specified for a file that has unique keys.

2. Rebuild maintenance cannot be specified for a file if its access path is being journaled.

MAINT parameter tips

The type of access path maintenance to specify depends on the number of records and the frequency of additions, deletions, and updates to a file while the file is closed.

You should use delayed maintenance for files that have relatively few changes to the access path while the file members are closed. Delayed maintenance reduces system overhead by reducing the number of access paths that are maintained immediately. It may also result in faster open processing, because the access paths do not have to be rebuilt. You may want to specify immediate maintenance for access paths that are used frequently, or when you cannot wait for an access path to be rebuilt when the file is opened. You may want to specify delayed maintenance for access paths that are not used frequently, if infrequent changes are made to the record keys that make up the access path.

In general, for files used interactively, immediate maintenance results in good response time. For files used in batch jobs, either immediate, delayed, or rebuild maintenance is adequate, depending on the size of the members and the frequency of changes.

19) How to copy 1000 record from 10000 records using CPYF, tell the keywords.

20) What’s the difference between CALL, CALLB, CALLP when are they used?

21) What are the different ways of transferring control from one pgm to another?

22) DataQ’s, what happens to the dataq after the data has been sent?

23) What is an access path?

In document As400 Interview Questions (Page 113-116)