midrange.com code scratchpad
Name:
Procedure to check for minimum release level
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
04/29/2008 05:05:57 pm
IP:
Logged
Description:
The user was to lazy to give a description
Code:
  1.       // This program is free software: you can redistribute it and/or modify
  2.       // it under the terms of the GNU General Public License as published by
  3.       // the Free Software Foundation, either version 3 of the License, or
  4.       // (at your option) any later version.
  5.       // 
  6.       // This program is distributed in the hope that it will be useful,
  7.       // but WITHOUT ANY WARRANTY; without even the implied warranty of
  8.       // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9.       // GNU General Public License for more details.
  10.       // 
  11.       // You should have received a copy of the GNU General Public License
  12.       // along with this program.  If not, see <http://www.gnu.org/licenses/>.
  13.      
  14.      H dftactgrp(*no)
  15.  
  16.      DosIsAtLeast      PR              N
  17.      D pMinimumOs                     9    const
  18.  
  19.       /free
  20.        if osIsAtLeast('V05R01M00');
  21.          dsply 'V5R1M0';
  22.         endif;
  23.  
  24.        if osIsAtLeast('V05R02M00');
  25.          dsply 'V5R2M0';
  26.         endif;
  27.  
  28.        if osIsAtLeast('V05R03M00');
  29.          dsply 'V5R3M0';
  30.         endif;
  31.  
  32.        if osIsAtLeast('V05R04M00');
  33.          dsply 'V5R4M0';
  34.         endif;
  35.  
  36.        if osIsAtLeast('V06R01M00');
  37.          dsply 'V6R1M0';
  38.         endif;
  39.  
  40.        *inlr = *on;
  41.  
  42.       /end-free
  43.  
  44.      PosIsAtLeast      B                   export
  45.      D                 PI              N
  46.      D pMinimumOs                     9    const
  47.  
  48.      DibmQUSROBJD      PR                  extpgm(QUSROBJD)
  49.      D pReciver                   32767    options(*varsize)
  50.      D pReciverLen                   10I 0 const
  51.      D pFormat                        8    const
  52.      D pObjLib                       20    const
  53.      D pObjType                      10    const
  54.      D pError                              likeds(QUSEC)
  55.  
  56.      D OBJD0300data    DS                  likeds(QUSD0300)
  57.      D pass            S               N   inz(*off)
  58.      D error           DS                  likeds(QUSEC)
  59.      D qsysLibrary     DS                  qualified
  60.      D  name                         10    inz('QSYS')
  61.      D  lib                          10    inz('*LIBL')
  62.      D releaseLevel    S              9    inz(*blank) static
  63.  
  64.       /copy QSYSINC/QRPGLESRC,QUSROBJD
  65.       /copy QSYSINC/QRPGLESRC,QUSEC
  66.  
  67.       /free
  68.        if releaseLevel = *blank;
  69.          // we only need to get the system level of QSYS once, as
  70.          // the release level can't change in the same job.
  71.  
  72.          // get the system level for library QSYS
  73.          ibmQUSROBJD(OBJD0300data:%size(OBJD0300data):'OBJD0300':
  74.            qsysLibrary:'*LIB':error);
  75.          releaseLevel = OBJD0300data.QUSSL08;
  76.        endif;
  77.  
  78.        // compare the value to the passed in release
  79.        pass = (releaseLevel >= pMinimumOS);
  80.  
  81.        return pass;
  82.       /end-free
  83.      P                 E 
© 2004-2019 by midrange.com generated in 0.005s valid xhtml & css