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.
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.
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.
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
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.
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
How about: RTVOBJD OBJ(QSYS/QCMD) OBJTYPE(*PGM) SYSLVL(&syslvl) On my v3r7 system this returns: V03R07M00. Derek
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!
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.
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.
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. 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