The GetPtnInfo procedure information about the partition for the job that calls this procedure.
The GetPtnInfo procedure can be used to retrieve information about the current partition in which the job is running and other partition-related information.
partion-info GetPtnInfo( nReserved 5I 0 Const Options(*NOPASS) ) |
|
See also: GetSysValue GetCPUCount |
If the function succeeds, the return value is a data structure containing the following partition information. The following subfields are included in the information returned.
D XT_PTNINFO DS Inz
/IF DEFINED(*V5R1M0)
D QUALIFIED
/ENDIF
D PtnID 10I 0
D PrimPtnID 10I 0
D PtnCount 10I 0
D CurProc 10I 0
D MinProc 10I 0
D MaxProc 10I 0
D CurMemSize 10U 0
D MinMemSize 10U 0
D MaxMemSize 10U 0
D CurProcCap 10U 0
D MinProcCap 10U 0
D MaxProcCap 10U 0
D CurIntWork 10I 0
D MinIntWork 10I 0
D MaxIntWork 10I 0
D bHSLUsage 1N
| Subfield | Data-Type | Description |
| PtnID | Int4 | Partition ID of the partition running the job |
| PrimPtnID | Int4 | Primary Partition ID |
| PtnCount | Int4 | Number of Partitions on the system |
| CurProc | Int4 | Current number of CPU Processors on the system |
| MinProc | Int4 | Minimum number of CPU Processors |
| MaxProc | Int4 | Maximum number of CPU Processors |
| CurMemSize | Unsigned Int4 | Current Partition Memory Size |
| MinMemSize | Unsigned Int4 | Minimum memory for a Partition |
| MaxMemSize | Unsigned Int4 | Maximum memory for a partition |
| CurProcCap | Unsigned Int4 | Current processor capacity |
| MinProcCap | Unsigned Int4 | Minimum processor capacity |
| MaxProcCap | Unsigned Int4 | Maximum processor capacity |
| CurIntWork | Int4 | Current interactive work load |
| MinIntWork | Int4 | Minimum interactive work load |
| MaxIntWork | Int4 | Maximum interactive work load |
| bHSLUsage | Indy | 1 = HSL (high speed link) is being used; 0 = HSL is not being used |
If the function fails, the return value is empty.
This procedure does not change any existing value.
To retrieve the current partition ID along with the Primary Partition ID and the number of active partitions, the following code may be used:
/INCLUDE qcpysrc,sysvalue
.....DName+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++++
D PtnInfo DS Inz
D PtnID 10I 0
D PrimPtnID 10I 0
D PtnCount 10I 0
.....CSRn01..............OpCode(ex)Extended-factor2+++++++++++++++++++++++++++
C eval PtnInfo = GetPtnInfo()
The data structure PtnInfo shown above can be declared in the source member or /INCLUDE'd into the source member from the QCPYSRC source file. The include name is XT_PTNINFO and is set up to be a qualified data structure under Version 5, Release 1 and later and a regular data structure on previous releases. There is the potential for name collision when the non-qualified version of the data structure is used.
Another method to include the data structure would be to use the LIKEDS keyword and reference the XT_PTNINFO data structure, as follows:
/INCLUDE qcpysrc,sysvalue
/INCLUDE qcpysrc,ptninfo
.....DName+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++++
D PtnInfo DS Inz LIKEDS(XT_PTNINFO)
.....CSRn01..............OpCode(ex)Extended-factor2+++++++++++++++++++++++++++
C eval PtnInfo = GetPtnInfo()
All LIKEDS data structures are automatically qualified data structures. All XT_* data structure contain a BASED(@_) keyword so that they use no storage. That is you cannot store data directly in the XT_PTNINFO data structure since it does not have any storage of its own. Instead, use the LIKEDS keyword (or the LIKE keyword on OS/400 Version 4) to declare a data structure with the same format as the XT_PTNINFO template.