WIN$VERSION

Returns version information for Windows and Windows NT host platforms.
Note: This ACUCOBOL-GT library routine is available in this COBOL version. Any compatibility issues in this COBOL system are in the Compatibility Issues section at the end of the topic.

This routine provides more information about the system than is returned by the ACCEPT FROM SYSTEM-INFO statement.

Usage

CALL "WIN$VERSION" 
    USING WINVERSION-DATA

Parameters

WINVERSION-DATA Group item as follows:
01  WINVERSION-DATA. 
    03  WIN-MAJOR-VERSION     PIC X COMP-X. 
    03  WIN-MINOR-VERSION     PIC X COMP-X. 
    03  WIN-PLATFORM          PIC X COMP-X. 
        88  PLATFORM-WIN-31   VALUE 1. 
        88  PLATFORM-WIN-95   VALUE 2. 
        88  PLATFORM-WIN-9X   VALUE 2. 
        88  PLATFORM-WIN-NT   VALUE 3. 
    03  WIN-WORDSIZE          PIC X COMP-X. 
        88  WIN-WORDSIZE-16   VALUE 1. 
        88  WIN-WORDSIZE-32   VALUE 2. 
        88  WIN-WORDSIZE-64   VALUE 3. 
    03  WIN-BUILDNUMBER                 PIC X(4) COMP-X. 
    03  WIN-CSDVERSION                  PIC X(128). 
    03  WIN-SERVICEPACK-MAJOR           PIC X COMP-X. 
    03  WIN-SERVICEPACK-MINOR           PIC X COMP-X. 
    03  WIN-SUITEMASK                   PIC X(4) COMP-X. 
    03  WIN-PRODUCTTYPE                 PIC X COMP-X. 
        88 WIN-NT-WORKSTATION           VALUE 1. 
        88 WIN-NT-DOMAIN-CONTROLLER     VALUE 2. 
        88 WIN-NT-SERVER                VALUE 3. 

WINVERSION-DATA is found in the COPY library winvers.def.

Comments

Upon return from WIN$VERSION, all of the data elements contained in WINVERSION-DATA are filled in. If you call WIN$VERSION and the host machine is not a Windows or Windows NT system, the fields are set to zero.

The WINVERSION-DATA fields have the following meaning:

  • WIN-MAJOR-VERSION - The major version number reported by Windows. See table below for possible values.
  • WIN-MINOR-VERSION - The minor version number reported by Windows. See table below for possible values.
Windows Version WIN-MAJOR-VERSION WIN-MINOR-VERSION Other
Windows XP 5 1 Not applicable.
Windows XP Professional x64 Edition 5 2 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION) && (SYSTEM_INFO.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64
Windows Vista 6 0 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows 7 6 1 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2012 6 2 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2008 R2 6 1 OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows Server 2008 6 0 OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows Server 2003 R2 5 2 GetSystemMetrics(SM_SERVERR2) != 0
Windows Home Sever 5 2 OSVERSIONINFOEX.wSuiteMask & VER_SUITE_WH_SERVER
Windows Server 2003 5 2 GetSystemMetrics(SM_SERVERR2) == 0
  • WIN-PLATFORM - Provides a general description of the host system. If the host is Windows NT/Windows 2000, the value is set to PLATFORM-WIN-NT. If the host is Windows 98, the value is set to PLATFORM-WIN-9X.
  • WIN-WORDSIZE - This item is set to WIN-WORDSIZE-32 for a 32-bit operating system, and WIN-WORDSIZE-64 for a 64-bit operating system.
  • WIN-BUILDNUMBER - Identifies the build number of the operating system.
  • WIN-CSDVERSION - Indicates the latest Service Pack installed on the system. If no Service Pack has been installed the string is empty.
  • WIN-SERVICEPACK-MAJOR - Indicates the major version number of the latest Service Pack installed on the system. If no Service Pack has been installed the value is 0.
  • WIN-SERVICEPACK-MINOR - Indicates the minor version number of the latest Service Pack installed on the system. If no Service Pack has been installed the value is 0.
  • WIN-SUITEMASK - This is a bit mask that identifies the product suites available on the system. Refer to the operating system documentation for a list of possible values.
  • WIN-PRODUCTTTYPE - Identifies additional information about the system.

Compatibility Issues

The copybook winvers.def is not available in this COBOL system.

The following fields are not supported in this COBOL system:

  • WIN-BUILDNUMBER
  • WIN-CSDVERSION
  • WIN-SERVICEPACK-MAJOR
  • WIN-SERVICEPACK-MINOR
  • WIN-SUITEMASK
  • WIN-PRODUCTTTYPE

These fields will return spaces or zeroes, as appropriate.