fhg
Volume 8, Number 10 -- March 12, 2008

Detect Host OS and Client Version Levels within Client Software

Published: March 12, 2008

by 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


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
E-mail: software@worksright.com
Web site: www.worksright.com


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

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


 
The Four Hundred
IBM Readies Big Power6 Boxes, New X64 Servers

System i Security: Lots of Room for Improvement

Server Virtualization and Consolidation Require More Resiliency

Thermometer Money: Changing a Business Partner Paradigm

Arrow Buys French Midrange Distributor

The Linux Beacon
AMD Says Barcelona Bug Is Fixed, Almost Ready to Ramp

HPC Sales Account for Most of 2007's Server Sales Growth

IBM Readies Big Power6 Boxes, New X64 Servers

Canonical Ships Landscape System Management Tool for Ubuntu

Surf's Up for Web-Based Organized Crime, IBM X-Force Says

Four Hundred Stuff
Solidcore Supports i5/OS with Real-Time Change Control

Vision to Support IBM's HASM Technology in Clustering Software

CodeGear Offers a Rational Alternative for System i Development

TDCI Hooks Product Configurator into i5/OS ERP

Fax Added to System i VoIP Solutions

Big Iron
Making the Case for System z10 Server Consolidation

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
March 8, 2008: Volume 10, Number 10

March 1, 2008: Volume 10, Number 9

February 23, 2008: Volume 10, Number 8

February 16, 2008: Volume 10, Number 7

February 9, 2008: Volume 10, Number 6

February 2, 2008: Volume 10, Number 5

The Windows Observer
Ballmer Shrugs Off $1.4 Billion Fine from EU

Linux and Windows Server Sales Outpace the Market in Q4

Microsoft Touts Speed, Simplicity of Windows Server 2008

SMBs Get the MOS Attention From Microsoft

Yahoo Says Microsoft Bid is Hurting Business

The Unix Guardian
AMD Says Barcelona Bug Is Fixed, Almost Ready to Ramp

Linux and Windows Server Sales Outpace the Market in Q4

MetaRAM Quadruples DDR2 Memory Capacity in Servers

Mad Dog 21/21: Plane's Peeking

Infinite Software Partners with HP, Acquires Altos Technology Group

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

WorksRight Software
Profound Logic Software
Guild Companies


Printer Friendly Version


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

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
Data Type *DEC in MSGF

How to identify when the OS upgrade was performed ???

FTP in arrival sequence

S36 environment problem

QSH won't write in batch!





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement