To determine the Progress/OpenEdge version in which 4GL/ABL code is running, use the PROVERSION function.
The PROVERSION function was enhanced in OpenEdge 11.2 to return full version information.
Prior to OpenEdge 11.2, the PROVERSION function does not return information about service pack / hot fix level
For example:
- Using PROVERSION in earlier releases than 11.2 or using PROVERSION(0) in release 11.2 and later, will provide the major and minor version numbers.
- Using PROVERSION(1) in release 11.2 or later displays the major, minor, service pack, hotfix and build numbers.
Note that the PROVERSION function does not provide information about processor architecture (32-bit vs. 64-bit).
To find out how to determine whether your OpenEdge release was built using 32 or 64 Bit architecture (bitness) see the following Progress knowledgebase Article:
00054631,
How to programmatically determine bitness in ABL?The following code can be used to gather the OpenEdge version including Service Pack and Hot Fix level.
/* getVersionFromVersionFile.p */
DEFINE VARIABLE cDLC AS CHARACTER NO-UNDO.
DEFINE VARIABLE cInput AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSlash AS CHARACTER INITIAL "~/" NO-UNDO.
DEFINE VARIABLE cVersionFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE cVersion AS CHARACTER NO-UNDO.
IF (OPSYS EQ "WIN32") THEN DO:
cSlash = "~\".
GET-KEY-VALUE SECTION "Startup" KEY "DLC" VALUE cDLC.
END.
IF cDLC EQ ? OR cDLC EQ "" THEN
cDLC = OS-GETENV("DLC").
IF cDLC = "" or cDLC = ? THEN DO:
MESSAGE "DLC has not been set. Please set DLC before running again."
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RETURN.
END.
cVersionFile = cDLC + cSlash + "version".
INPUT FROM VALUE(cVersionFile).
REPEAT:
IMPORT UNFORMATTED cInput NO-ERROR.
IF ERROR-STATUS:ERROR THEN
RETURN.
IF INDEX(cInput,"Release") GT 0 THEN
cVersion = ENTRY(LOOKUP("Release",cInput," ") + 1,cInput," ").
IF INDEX(cInput,"Version") > 0 THEN
cVersion=ENTRY(LOOKUP("Version",cInput," ") + 1,cInput," ").
END.
MESSAGE 'Progress/OpenEdge Version:' cVersion
VIEW-AS ALERT-BOX INFO BUTTONS OK.