• 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
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    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

  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

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