/* */ call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call SysLoadFuncs call ReadSysLevel("e:\OS2\INSTALL\SYSLEVEL.ECS") say "SlfVersion" slfh.usSlfVersion say "usSysId" st.usSysId say "edition:" st.bSysEdition "version: " st.bSysVersion "modify" st.bSysModify say st.achSysName say st.bRefreshLevel exit; /****************************************************************************** * ReadSysLevel * * * * This procedure is (probably) (C) IBM. Parses a SYSLEVEL file. * ******************************************************************************/ ReadSysLevel: procedure expose slfh. st. parse arg fs res = 0 if stream(fs,"C","Query Exists") <> "" then do data = charin(fs,1,chars(fs)) slfh.usSignature = c2x(reverse(substr(data,1,2))) /* special # for id of syslevel file */ slfh.achSignature = substr(data,3,8) /* string to id slf file, must be 'SYSLEVEL' */ slfh.achJulian = substr(data,11,5) /* date of version */ slfh.usSlfVersion = c2x(reverse(substr(data,16,2))) /* version of syslevel file, must be 1 */ slfh.ausReserved = c2x(substr(data,18,16)) /* reserved */ slfh.ulTableOffset = c2d(reverse(substr(data,34,4))) /* offset of SYSTABLE */ /* Calculate table start */ tblst = slfh.ulTableOffset+1 st.usSysId = c2x(reverse(substr(data, tblst+0,2))) /* identifies system /subsytem */ st.bSysEdition = c2x(substr(data, tblst+2,1)) /* edition of system, eg SE=00, EE=01 */ st.bSysVersion = c2x(substr(data, tblst+3,1)) /* version, eg 1.00=10, 1.10=11 */ st.bSysModify = c2x(substr(data, tblst+4,1)) /* modify, eg 1.00=00, 1.01=01 */ st.usSysDate = c2x(reverse(substr(data, tblst+5,2))) /* date of system */ st.achCsdLevel = substr(data, tblst+7,8) /* subsytem CSD level, eg, XR?0000_ */ st.achCsdPrev = substr(data, tblst+15,8) /* as above, except for prev system */ st.achSysName = substr(data, tblst+23,80) /* Title of system / subsytem (ASCIIZ) */ st.achCompId = substr(data, tblst+103,9) /* component ID of subsytem */ st.bRefreshLevel = c2x(substr(data, tblst+112,1)) st.achType = substr(data, tblst+113,9) /* Null terminated type (8 chars +'\0') */ st.usReserved = substr(data, tblst+122,12) /* reserved, must be 0 */ res = 1 call stream fs,"C","Close" end return res