Where allowed to run:
|
Parameters Examples Error messages |
The APPTOOLS - Retrieve OS VxRyMz (RTVOSVER) command returns the current IBM i operating system version, release, and modification level to a user-supplied CL variable.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
RTNVRM | CL Var for OS VxRyMz | Character value | Optional, Positional 1 |
RTNVER | CL Var for OS Version | Character value | Optional, Positional 2 |
RTNREL | CL Var for OS Release | Character value | Optional, Positional 3 |
RTNMOD | CL Var for OS Modification | Character value | Optional, Positional 4 |
Top |
Specifies a CL variable that receives the IBM i version in VxRyMz format. Normally a CL variable TYPE(*CHAR) LEN(6) is specified, but any length CL variable may be specified. For example, if the version of IBM i running is v7.1 it is returned as 'V7R1M0'. NOTE: When a shorter value is specified, only that portion of the VxRyMz is returned. For example if the return CL variable is LEN(4) then 'V7R1' is returned.
Top |
Specifies a CL variable that receives the IBM i version number in character format. The VERISON is returned as a 2-position character value. When the return CL variable is LEN(2) or greater, then '05', '06', or '07' is returned. When a LEN(1) variable is specified, then '5', '6', or '7' is returned.
Top |
Specifies a CL variable that receives the IBM i release number in character format. The RELEASE is returned as a 2-position character value. When the return CL variable is LEN(2) or greater, then '01', '02', '03' etc. is returned. When a LEN(1) variable is specified, then '1', '2', '2' etc. is returned.
Top |
Specifies a CL variable that receives the IBM i modification level in character format. The MODIFICATION is returned as a 2-position character value. When the return CL variable is LEN(2) or greater, then '00', '01', '05' etc. is returned. When a LEN(1) variable is specified, then '0', '1', '5' etc. is returned.
Top |
Example 1: Simple Command Example
DCL &VRM TYPE(*CHAR) LEN(6) RTVOSVER VRM(&VRM) IF (&VRM >= 'V7R1M0') THEN(DO) /* Do something for v7.1 and later here. ENDDO ELSE DO /* Do v6.1 and earlier stuff here ENDDO
This command retrieves the full IBM i OS version identifier and then checks to see if the program is running on a v7r1 or later system.
Example 2: More Complex Command Example
DCL &VER TYPE(*CHAR) LEN(1) DCL &REL TYPE(*CHAR) LEN(1) RTVOSVER VER(&VER) REL(&REL) IF (&VER >= '7' *AND &REL >= '2') THEN(DO) SNDPGMMSG MSG('You are running IBM i v7r2 or later.') enddo
This command receives the Version and Release into 1-position *CHAR CL variables and then uses them in the conditional statement.
Top |
*ESCAPE Messages
Top |