This section describes what happens when the following internal database functions are created over physical (PHY) access paths: Retrieve object (RTVOBJ), Change object (CHGOBJ), Delete object (DLTOBJ), and Create object (CRTOBJ).
A RTVOBJ created over a PHY access path has one *Relative record number (RRN) parameter by default:
|
Parameters |
Usage |
Role (default) |
Default |
|---|---|---|---|
|
*Relative record number |
I |
RST/POS (POS) |
Y |
|
Any other fields |
Any |
none |
none |
This *Relative record number parameter can be used as a "key" to the physical file as follows:
RRN as a Restrictor Parameter (I, B, or N) to a PHY RTVOBJ—If the RRN for a RTVOBJ function built over a PHY access path is a Restrictor parameter, only the record with RRN equal to the parameter value is read.
RRN as a Positioner Parameter (I, B, or N) to a PHY RTVOBJ—If the RRN for a RTVOBJ function built over a PHY access path is a Positioner parameter, only records with RRN greater than or equal to the parameter value are read.
RRN as an Output Parameter from a PHY RTVOBJ—If the RRN for a RTVOBJ function built over a PHY access path is an Output parameter, all records in the access path are read, starting with record 1. The RRN of the last record read from the file is passed as the parameter value.
RRN as a Neither Parameter to a PHY RTVOBJ—If the RRN for a RTVOBJ function built over a PHY access path is a Neither parameter, the RRN first used to access the file is the current value of the Neither parameter. The Neither parameter is accessible from the RTVOBJ in the PAR context. Although the parameter is initialized to 1 in the RTVOBJ, it can be changed to any numeric value in the User Exit Point USER: Initialize routine. The value following that User Exit Point is used to access the file initially.
Deleting the RRN Parameter to a PHY RTVOBJ—If the default RRN parameter is deleted, two outcomes are possible:
Note: You can add other parameters besides RRN to PHY RTVOBJ functions, but RRN must be passed first.
The following is a quick reference table for processing the *Relative record number parameter:
|
Usage |
Role |
Initialized in RTVOBJ? |
Record Processing |
Value Returned |
|---|---|---|---|---|
|
I |
RST |
No |
Single |
None |
|
I |
POS |
No |
Single or multiple* |
None |
|
B |
RST |
No |
Single |
RRN of last record read |
|
B |
POS |
No |
Single or multiple* |
RRN of last record read |
|
N |
RST |
Neither PAR |
Single |
None |
|
N |
POS |
Neither PAR |
Single or multiple* |
None |
|
O |
n/a |
1 |
Single or multiple* |
RRN of last record read |
|
Not used |
n/a |
1 |
Single or multiple* |
None |
In a normal CHGOBJ, the processing includes these steps:
1. USER: Processing before data read.
2. Load key fields to record format.
3. Access file to check if record exists.
4. USER: Processing if data record not found.
5. If record not found, send error message and quit.
6. If record locked, send error message and quit.
7. USER: Processing after data read.
8. Load non-key fields to record format.
9. USER: Processing before data update.
10. Update record.
11. If update failed, send error message and quit.
12. USER: Processing after data update.
In a CHGOBJ built over a PHY access path, the processing includes these steps:
1. Load key and non-key fields to record format.
2. USER: Processing before data update.
3. Update record.
4. If update failed, send error message and quit.
5. USER: Processing after data update.
The following notes apply to these situations:
In a normal DLTOBJ, the processing includes these steps:
1. USER: Processing before data update.
2. Access file to check if record still exists.
3. If record already deleted, send error message and quit.
If record locked, send error message and quit.
5. Delete record.
6. If delete failed, send error message and quit.
7. USER: Processing after data update.
In a DLTOBJ built over a PHY access path, the processing includes these steps:
1. USER: Processing before data update.
2. Delete record.
3. If delete failed, send error message and quit.
4. USER: Processing after data update.
The following notes apply to these situations:
Create object (CRTOBJ)
In a normal CRTOBJ, the processing includes these steps:
1. Load parameters to record format.
2. USER: Processing before data update.
3. Access file to check if record already exists.
4. USER: Processing if data record already exists.
5. If record already exists, send error message and quit.
6. Write record.
7. USER: Processing if data update error.
8. If write failed, send error message and quit.
9. USER: Processing after data update
In a CRTOBJ built over a PHY access path, the processing includes these steps:
1. Load parameters to record format.
2. USER: Processing before data update.
3. Write record.
4. USER: Processing if data update error.
5. If write failed, send error message and quit.
6. USER: Processing after data update.
The following notes apply to these situations:
Using Functions Built Over PHY Access Paths
This is a quick reference table with information about functions built over PHY access paths:
|
Database Function |
Attaching to: |
Allowed by Compiler? |
Action Diagram Editor Error? |
|---|---|---|---|
|
Retrieve object |
CRTOBJ over same PHY access path |
No |
Yes |
|
Retrieve object |
Other function |
Yes |
n/a |
|
Change object |
RTVOBJ over same PHY access path |
Yes |
n/a |
|
Change object |
Other function |
No |
Yes |
|
Delete object |
RTVOBJ |
Yes |
n/a |
|
Delete object |
Other function |
No |
Yes |
|
Create object |
RTVOBJ over same PHY access path |
No |
Yes |
|
Create object |
Other function containing RTVOBJ |
No |
No |
|
Create object |
Other function |
Yes |
n/a |
Consider the following points when using functions built over PHY access paths:
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |