|
Introduction
Retrieves the SIZE() attributes of an ISeries database physical
file to variables in a CL program. For example if the file has SIZE(10000 1000
3), then the 3 values - 10000, 1000, 3 - are retrieved to variables. This is
one of the commands in our ISeries
utilities library (click this URL for full contact and pricing
details).
This command uses the QDBRTVFD ISeries API. This is much faster
than using the DSPFD OUTPUT(*OUTFILE) TYPE(*ATR) command to generate an output
file that you then read to determine the SIZE() attributes.
|
|
Command Parameters
The PRTVPFSZ command has the following
parameters:
| FILE |
The name of the physical file (qualified by library) on the
ISeries whose SIZE() attributes you want to retrieve. |
| PHSIZ |
The name of a variable in your CL program to hold the value
of the initial number of records for the physical file. The variable must be
defined as TYPE(*DEC) LEN(15 0). Zero will be returned for this value if the
file has SIZE(*NOMAX). |
| PHSIZI |
The name of a variable in your CL program to hold the value
of the increment number of records for the physical file. The variable must be
defined as TYPE(*DEC) LEN(8 0). |
| PHSIZM |
The name of a variable in your CL program to hold the value
of the maximum number of increments for the physical file. The variable must be
defined as TYPE(*DEC) LEN(8 0). |
|
|
Example
DCL VAR(&INIT) TYPE(*DEC) LEN(15 0) /* Initial number of
records */ DCL VAR(&INCR) TYPE(*DEC) LEN(8 0) /* Increment number of
records */ DCL VAR(&INCRN) TYPE(*DEC) LEN(15 0) /* Maximum number of
increments */ PRTVPFSZ FILE(QGPL/MASTPF) PHSIZ(&INIT) PHSIZI(&INCR)
PHSIZM(&INCRN) IF COND(&INIT *EQ 0) THEN(CRTPF FILE(QTEMP/TEMPPF)
SIZE(*NOMAX)) IF COND(&INIT *GT 0) THEN(CRTPF FILE(QTEMP/TEMPPF)
SIZE(&INIT &INCR &INCRN))
Program above runs the PRTVPFSZ command to retrieve SIZE()
attributes into CL variables and uses those to create a temporary file with the
same SIZE() attributes. |
|
Restrictions
| 1) |
The file must be a local physical file, not a logical file
or DDM file. If the QDBRTVFD API has any run-time problem, a zero value is
returned for the PHSIZ variable. |
|
IBM rebranded the AS/400 - some users called it AS400 - to
ISeries several years ago. All 3 names - ISeries, AS/400, AS400 - refer to
exactly the same system. |