July 7

2 comments

Find the IBMi (iSeries AS400) Operating System Version using SQL

By NickLitten

July 7, 2022

SQL

Ever wanted to find your IBM i OS Version using SQL?

Following on from this blog about how to find the OS version from an RPG Program, a nice chap called Tomas Petris left a comment showing a slick way of pulling the IBM i Version with one SQL statement:

Find the ibmi (iseries as400) operating system version using sql

The SQL statement is simple and looks like this:

SELECT substring(DATA_AREA_VALUE, 1, 8) FROM qsys2.data_area_info
WHERE data_area_library = 'QUSRSYS' and data_area_name = 'QSS1MRI'

You can enter this into your ACS SQL Script tool or simply into the terminal mode (5250 Emulator) using STRSQL:

Find the ibmi (iseries as400) operating system version using sql

The results are simple and clear:

Find the ibmi (iseries as400) operating system version using sql
  • Solution without substring :
    SELECT DATA_AREA_VALUE FROM TABLE(QSYS2.DATA_AREA_INFO(DATA_AREA_LIBRARY=>’QUSRSYS’,DATA_AREA_NAME=>’QIZAVRM’)) X;
    (‘QTOIVRM’ also works)

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips

    >