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:
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:
The results are simple and clear:
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)
Another excellent solution.
And for those that just want to use commands, its – DSPDTAARA DTAARA(QUSRSYS/QIZAVRM)