(view source code of rxsyslvl.cmd as plain text)
/* Determine OS/2 version and fixpack level *//* Original Rexx script by Mike Ruskai *//* Adapted to [a] include international versions, */ /* and [b] add return codes by Rob van der Woude *//* Check for command line parameters */parse upper arg param dummy
if param <> "" then do
if dummy <> "" then call Syntax
parse value param with dummy"/"option
if dummy <> "" then call Syntax
if option <> "" then option = left( option, 1 )
selectwhen option = "B" then returncode = "OS2VER"
when option = "F" then returncode = "FPLEVEL"
when option = "O" then returncode = "OS2VER"
otherwise call Syntax
endend/* Initialize RexxUtil */if RxFuncQuery( "SysLoadFuncs" ) <> 0 then do
call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
call SysLoadFuncsend/* Check Rexx version and use the appropriate *//* method to determine the boot drive */parse version verstring
if word( verstring , 1 ) = "OBJREXX" then do
bootdrive = SysBootDrive( )
endelse do
path = value( "PATH", , "OS2ENVIRONMENT" )
parse upper value path with ":\OS2\SYSTEM" -1 bootdrive +2
if path = "" | bootdrive = "" then do
saysay "Unable to determine boot drive"
exit 9
endend/* Read SYSLEVEL.OS2 and extract version strings */syslevel = bootdrive||"\OS2\INSTALL\SYSLEVEL.OS2"
check = stream( syslevel, "c", "open read" )
if check = "" then do
saysay "Unable to open SYSLEVEL.OS2"
exit 8
endleveldata = charin( syslevel, , chars( syslevel ) )
call stream syslevel, "c", "close"
/* Check and format version strings */parse var leveldata "XR" fplevel "_XR" os2ver "_IBM"
fplevel = right( fplevel, 3 )
os2ver = right( os2ver, 4 ) / 1000
if strip( fplevel ) = "" | datatype( fplevel, "W" ) = 0 |,
strip( os2ver ) = "" | datatype( os2ver, "W" ) = 0 then do
saysay "Unable to determine version and fixpack level"
exit 7
end/* Read SYSLEVEL.FPK and extract fixpack version */syslevel = bootdrive||"\OS2\INSTALL\SYSLEVEL.FPK"
check = stream( syslevel, "c", "open read" )
if check <> "" then do
leveldata = charin( syslevel, , chars( syslevel ) )
parse var leveldata "XR" fplevel "_XR"
fplevel = right( fplevel, 3 )
if strip( fplevel ) = "" | datatype( fplevel, "W" ) = 0 then do
saysay "Unable to determine fixpack level"
endendcall stream syslevel, "c", "close"
/* Format fixpack version string */fplevel = format( fplevel, , 0 )
/* Display results */say "OS/2 base version: "||os2ver
say "OS/2 fixpack level: "||fplevel
/* Quit */if returncode = "OS2VER" then exit os2ver
if returncode = "FPLEVEL" then exit fplevel
exit 0
Syntax:
saysay "RxSysLvl"
say "Returns OS/2 Version and FixPack Level"
saysay "Usage: RXSYSLVL [ /Base_version | /Fixpack_level ]"
saysay " /B return code = OS/2 Major Version Number"
say " /F return code = FixPack Level"
say " blank (none) return code = 0"
say " any other parameter return code = 255"
exit 255
returnpage last modified: 2025-10-11; loaded in 0.0059 seconds