View Full Version : Retrieving operating system level
01-01-1995, 02:00 AM
Charles, I think that you can use the RTVSYSVAL CL command. I'm not at work so I can't check the parameter for sure. The DSPSYSVAL Command can be used to see what the parameter is, if it exists.
01-08-1998, 04:25 AM
I don't think you can do this from a CL program. RTVSYSVAL definitely doesn't do it. There used to be a data area you could examine called something like Q5738SS1 but (a) the name of this data area reflected the OS/400 product number so it changed every now and again between release levels and (b) it was dropped at V3, so that doesn't help you much unless you're still at V2. I wouldn't recommend examining undocumented system objects like this anyway because you just don't know how reliable the information on them is. There are some APIs you can call to work with licensed products, but again, in order to use them you need to know the product ID you are interested in, which means you need to know which version of OS/400 you have installed, and if you knew that you wouldn't need to call the API. It's possible that one of the APIs might let you list off all the products installed so that you can work it out. I'm not really too familiar with these APIs - we looked at them briefly as a way of licensing our own software but didn't pursue it. They're documented in the API manual if you want to investigate them a bit more. The only 100% reliable way I know to find out the OS level is a manual process. GO LICPGM, then take option 10 Display Installed Licensed Programs and that will tell you exactly what version, release and modification you've got, but I don't know how you do the same thing from a program.
01-08-1998, 07:49 AM
Here is a CL program that uses a "brute force" method. I'm running V3R2M0 so I don't know if this would work on other releases or not. PGM DCLF FILE(QADSPPTF) DSPPTF OUTPUT(*OUTFILE) OUTFILE(QTEMP/PTFLIST) OVRDBF FILE(QADSPPTF) TOFILE(QTEMP/PTFLIST) RCVF /* OS version contained in variable &SCXPFV */ /* V3R2M0 = "030200" */ ENDPGM On my system, all records in the PTFLIST file had the 030200 for the OS version. I can't speak for other versions. Your mileage may vary! Good luck! Richard
01-08-1998, 01:02 PM
David, You are absolutely right. I just checked my system for RTVSYSVAL and there is no parameter for the OS level after all. It seems like has a method that works. It's strange that one can retrieve the model number, security level etc, but not the OS level.
01-08-1998, 03:49 PM
How about calling a RPG program that uses the SDS area. I cannot recall but is the OS version in there? Karl Lauritzen Second VP Project Development National Lloyds Ins
01-08-1998, 07:51 PM
How about: RTVOBJD OBJ(QSYS/QCMD) OBJTYPE(*PGM) SYSLVL(&syslvl) On my v3r7 system this returns: V03R07M00. Derek
01-09-1998, 06:56 AM
On Thursday, January 08, 1998, 08:51 PM, Derek Butland wrote: How about: RTVOBJD OBJ(QSYS/QCMD) OBJTYPE(*PGM) SYSLVL(&syslvl) On my v3r7 system this returns: V03R07M00. Derek Works on V3R2 as well. That's slick, Derek!
01-09-1998, 11:45 AM
Derek, your routine works great on my system as well. I think that you have a contender for the TechTalk section. It's a good routine, thanks for the tip again.
01-09-1998, 01:38 PM
I have already copied it to my techtalk subdirectory, so I can work it up & submit it to the editors. <font color="blue">On Friday, January 09, 1998, 12:45 PM, Mario Martinez wrote: Derek, your routine works great on my system as well. I think that you have a contender for the TechTalk section. It's a good routine, thanks for the tip again.</font>
01-09-1998, 05:13 PM
<font color="0000CC"> On Friday, January 09, 1998, 02:38 PM, Ted Holt wrote: I have already copied it to my techtalk subdirectory, so I can work it up & submit it to the editors. On Friday, January 09, 1998, 12:45 PM, Mario Martinez wrote: Derek, your routine works great on my system as well. I think that you have a contender for the TechTalk section. It's a good routine, thanks for the tip again. </font> Glad you guys found it useful. It's just a variation on a "tip" I remember reading in one of the magazines. Might have even been MC.... Derek
01-16-1998, 04:55 AM
Though there are many indirect ways to find the operating system level of an AS/400, the supported approach is to use the Retrieve Product Information (QSZRTVPR) API documented in the Software Products chapter of the System API Reference. By using special values of *OPSYS for Product Id and *CUR for Release Level one does not need to know anything other than that they are running on an AS/400 at V2R3 or later. A quick and dirty CL example would be: PGM DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(256) DCL VAR(&RELEASE) TYPE(*CHAR) LEN(6) CALL PGM(QSZRTVPR) PARM(&RCVVAR X'00000100' + 'PRDR0100' '*OPSYS *CUR 0000*CODE ' + X'00000000') CHGVAR PGMVAR(&RELEASE) VALUE(%SST(&RCVVAR 20 6)) ENDPGM
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.