• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Detect Host OS and Client Version Levels within Client Software

    March 12, 2008 Michael Sansoterra

    Sometimes when coding a Windows client/server application it can be a bit pesky dealing with the problem of knowing everything about the operating environment. In the System i and AS/400 world, factors like the host i5/OS version and release, and the iSeries Access (now called System i Access) version and fix pack level, can determine whether or not your software can run correctly. In the “IBM AS/400 iSeries Access for Windows ActiveX Object” library, IBM has given developers the tools to programmatically detect this information and thereby circumvent potential problems for environments that are not at the correct software level.

    Using Visual Basic for Applications (VBA) code, I’ll quickly demonstrate how to detect host OS and iSeries access version levels. In your VBA environment, you’ll need to add a reference to the “IBM AS/400 iSeries Access for Windows ActiveX Object” library in your project. For MS Office products, this is usually done under Tools→References.

    Say you have a client/server application that creates a table function to perform a certain function. However, if the host OS level is below V5R2, the function will fail because V5R2 was the first release to allow the creation of table functions. In this scenario, it would be better to inform the user that an OS upgrade is required than to show a cryptic error thrown due to an unsupported SQL statement.

    Dim host As cwbx.AS400System
    Dim strHostOS As String
    Set host = New cwbx.AS400System
    host.Define "MYHOSTNAME"
    strHostOS = "V" + CStr(host.HostVersion) + "R" + _
                CStr(host.HostRelease)
    If strHostOS < "V5R2" Then
        MsgBox "This Host Requires a Minimum of V5R2 to Run"
        Exit Sub
    End If
    

    Sample 1 – Code to check the release level of the host i5/OS version.

    The “AS400System” object provides HostVersion and HostRelease properties that indicate the host OS level. The Define method is used to register the name of the host System i or AS/400 to be used. This system must be registered within iSeries Navigator or an error will be thrown. See “Programmatically Retrieve Defined System i Names” to learn how to query the default system name or to retrieve a list of registered iSeries Navigator system names programmatically.

    There is one caveat: the code in Sample 1 doesn’t connect to the host, it just uses the value stored within iSeries Navigator. So in the cases where the host OS was just upgraded (but the client hasn’t yet connected) or when the host has never been used, these properties can return an erroneous version. If necessary, connect to your host system before querying these values.

    Now let’s look at how to examine the client version. I recently wrote a complex spreadsheet application for a client that had many users. The spreadsheet required the usage of the iSeries Access ODBC driver. However, this application worked for some users but generated an error for many others. It turns out that many of these users simply had older iSeries access installations that needed to be upgraded before the ODBC application would work. Adding code to verify a minimum client level before allowing the application to run is a good way to alert the user to the problem without generating ugly ODBC error messages!

    Here is another sample code that makes use of the IBM-supplied ClientInfo object. In particular, the ClientVersion and ClientRelease properties are concatenated to form the familiar VxRy level. Further, the ClientFixLevel property can be used to verify that a specific service pack level is present.

    Dim client As cwbx.ClientInfo
    Set client = New cwbx.ClientInfo
    Dim strClientVersion As String, strClientFixPack As String
    strClientVersion = "V" + CStr(client.ClientVersion) + "R" +
     CStr(client.ClientRelease)
    strClientFixLevel = client.ClientFixLevel
    If strClientVersion < "V5R3" Or _
    (strClientVersion = "V5R3" And strClientFixLevel < "SI21917") Then
        MsgBox "iSeries Access Client must be at a minimum level " & _
        "of V5R3 with Fix Pack SI21917 Installed. " & vbCrLf & _
        "Please Upgrade Client before using this Software"
        Exit Sub
    End If
    

    Sample 2 – Code to check the iSeries Access release level and fix pack level.

    Use IBM’s APIs to verify that minimum system requirements are met before allowing a client/server app to run. In this world of unknown host OS versions and back-leveled client software, doing a little coding up front will go a long way toward avoiding unnecessary troubleshooting.

    Michael Sansoterra is a programmer/analyst for i3 Business Solutions, an IT services firm based in Grand Rapids, Michigan. Click here to contact Michael Sansoterra by email.

    RELATED STORY

    Programmatically Retrieve Defined System i Names



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    New Generation Software

    FREE Webinar:

    Creating Great Data for Enterprise AI

    Enterprise AI relies on many data sources and types, but every AI project needs a data quality, governance, and security plan.

    Wherever and however you want to analyze your data, adopting modern ETL and BI software like NGS-IQ is a great way to support your effort.

    Webinar: June 26, 2025

    RSVP today.

    www.ngsi.com – 800-824-1220

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    MoshiMoshi:  An Interactive Experience for the System i Community. Coming March 30.
    COMMON:  Join us at the annual 2008 conference, March 30 - April 3, in Nashville, Tennessee
    Vision Solutions:  Disaster Recovery and Compliance – Get the Free e-Book!

    IT Jungle Store Top Book Picks

    Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
    Getting Started with PHP for i5/OS: List Price, $59.95
    The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket Developers' Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    iSeries Express Web Implementer's Guide: List Price, $59.00
    Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    WebFacing Application Design and Development Guide: List Price, $55.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    The All-Everything Machine: List Price, $29.95
    Chip Wars: List Price, $29.95

    New i5 Offering from TurboChef to Speed Batch Runs Bye Bye System p and i, Hello Power Systems

    2 thoughts on “Detect Host OS and Client Version Levels within Client Software”

    • Dionisis Kordonouris says:
      April 30, 2017 at 6:46 am

      strClientFixPack isn’t not active in your code

      Reply
    • Dionisis Kordonouris says:
      April 30, 2017 at 7:04 am

      adding CStr(strClientFixLevel) you get the service pack level

      Reply

    Leave a Reply Cancel reply

Volume 8, Number 10 -- March 12, 2008
THIS ISSUE SPONSORED BY:

WorksRight Software
Profound Logic Software
Guild Companies

Table of Contents

  • Detect Host OS and Client Version Levels within Client Software
  • More About SQL Correlation Names
  • Admin Alert: A Much Quicker Way to Move System i Objects Between Partitions

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle