midrange.com code scratchpad
Name:
ANZOBJCVN - For Pre V5R3 machines
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
10/04/2007 07:40:13 pm
IP:
Logged
Description:
When going to V6R1 any programs without observability, and compiled to a target release prior to V5R1, will need to be recompiled.
See:
http://www.redbooks.ibm.com/abstracts/redp4293.html

See also: (give it some time to be posted)
http://think400.dk/downloads.htm
Code:
  1. ---------------------------------------------------------------------------------------
  2. README, Member 1 of 8:
  3. Replace all occurences of library ROB with whatever you wish your
  4. *CURLIB to be in member SETUP.  Some SQL stuff will not accept *CURLIB.
  5.  
  6. Run the following commands:
  7. CHGCURLIB libraryContainingSourceFileANZOBJCVN
  8. RUNSQLSTM SRCFILE(ROB/ANZOBJCVN) SRCMBR(SETUP) COMMIT(*NONE)
  9.  
  10.  
  11. ---------------------------------------------------------------------------------------
  12. SETUP, Member 2 of 8:
  13. -- Set of SQL Statements to create custom ANZOBJCVN
  14.  
  15. -- Run this with:
  16. --   RUNSQLSTM SRCFILE(ROB/ANZOBJCVN) SRCMBR(SETUP) COMMIT(*NONE)
  17.  
  18. -- Step one:  Create module to be part of service program
  19. CALL QCMDEXC (
  20. 'CRTRPGMOD MODULE(*CURLIB/RTVOBSINF) SRCFILE(*CURLIB/ANZOBJCVN)',62);
  21.  
  22. -- Create service program to use this module
  23. CALL QCMDEXC (
  24. 'CRTSRVPGM SRVPGM(RTVOBSINF) EXPORT(*ALL)',40);
  25.  
  26. -- Create User Defined Function, or UDF, to call the two subprocedures
  27. -- in this service program
  28. CREATE FUNCTION RTVOBSINFUDF (
  29.  CHAR(10) ,
  30.  CHAR(10) ,
  31.  CHAR(8) ,
  32.  CHAR(10) )
  33.  RETURNS CHAR(1)
  34.  LANGUAGE RPGLE
  35.  SPECIFIC RTVOBSINFUDF
  36.  DETERMINISTIC
  37.  NO SQL
  38.  RETURNS NULL ON NULL INPUT
  39.  NO EXTERNAL ACTION
  40.  EXTERNAL NAME 'ROB/RTVOBSINF(RTVOBSINFUDF)'
  41.  PARAMETER STYLE GENERAL;
  42.  
  43. CREATE FUNCTION RTVTGTRLSUDF (
  44.     CHAR(10) ,
  45.     CHAR(10) ,
  46.     CHAR(8) ,
  47.     CHAR(10) )
  48.     RETURNS CHAR(6)
  49.     LANGUAGE RPGLE
  50.     SPECIFIC RTVTGTRLSUDF
  51.     DETERMINISTIC
  52.     NO SQL
  53.     RETURNS NULL ON NULL INPUT
  54.     NO EXTERNAL ACTION
  55.     EXTERNAL NAME 'ROB/RTVOBSINF(RTVTGTRLSUDF)'
  56.     PARAMETER STYLE GENERAL;
  57.  
  58. CALL QCMDEXC (
  59. 'DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*PGM *SRVPGM) OUTPUT(*OUTFILE)
  60.  OUTFILE(*CURLIB/DSPOBJDOUT)',104);
  61. -- 34567891123456789212345678931234567894123456789512345678961234567897123456789
  62. -- 3456789912345678901234567892
  63. -- Continuation assumes to end of the 80 character line.  Drop the first
  64. -- character for the leading apostrophe.  Leaving 79 useful characters on the
  65. -- first line.
  66.  
  67. CREATE TABLE QTEMP/FIRSTPASS AS (
  68. SELECT ODLBNM AS LIBRARY,
  69.   ODOBNM AS OBJECT,
  70.   ODOBTP AS TYPE,
  71.   ODOBAT AS ATTRIBUTE,
  72.   RTVTGTRLSUDF(ODLBNM, ODOBNM, ODOBTP, ODOBAT) AS TARGETRELEASE,
  73.   RTVOBSINFUDF(ODLBNM, ODOBNM, ODOBTP, ODOBAT) AS OBSERVABLEINFO,
  74.   ODOBOW AS OBJECTOWNER,
  75.   ODCRTU AS CREATEDBY
  76. FROM DSPOBJDOUT
  77. ORDER BY ODLBNM, ODOBNM)
  78. WITH DATA;
  79.  
  80. CREATE TABLE FIXTHESE AS (
  81. SELECT LIBRARY, OBJECT, TYPE, ATTRIBUTE, TARGETRELEASE, OBSERVABLEINFO,
  82.        OBJECTOWNER, CREATEDBY
  83. FROM QTEMP/FIRSTPASS
  84. WHERE OBSERVABLEINFO NOT IN('1', 'A')
  85.   AND (TARGETRELEASE NOT BETWEEN 'V5' AND 'V9')
  86. ORDER BY LIBRARY, OBJECT)
  87. WITH DATA;
  88.  
  89. DROP TABLE QTEMP/FIRSTPASS; 
  90.  
  91. ---------------------------------------------------------------------------------------
  92. RTVOBSINF, Member 3 of 8:
  93.       /IF NOT DEFINED(PROTOTYPESONLY)
  94.       // Retrieve program observability
  95.       // As part of Power 6 upgrade you need to know if you have:
  96.       // ILE programs or service programs that 'All creation data' = no
  97.       // OPM programs that have 'Observable information' = *NONE
  98.  
  99.       // Service programs and ILE programs:
  100.       //   0 *NO. Not all of the creation data is present. The creation template
  101.       //     program object could be missing or at least one of the modules in t
  102.       //     does not have creation data. The Display Service Program (DSPSRVPGM
  103.       //     *MODULE specified as the value for the DETAIL parameter can be used
  104.       //     module has creation data.
  105.       //   1 *YES. The ILE service program has all creation data and all of that
  106.       //   2 *UNOBS. The ILE service program has all creation data but not all o
  107.       //     observable.
  108.  
  109.       // OPM programs:
  110.       //   A *ALL. The program has all creation data and that data is observable
  111.       //   N *NONE. The program does not have all creation data.
  112.       //   U *UNOBS. The program has all creation data but not all of that data
  113.       //   Blank. The program is an ILE program.
  114.  
  115.       // Error conditions:
  116.       //   9 Error calling retrieve service program api.  See ExceptionId.
  117.       //   8 Object is neither a *PGM or a *SRVPGM.
  118.       //   7 Error calling retrieve program api.  See ExceptionId.
  119.  
  120.  
  121.      H NOMAIN
  122.  
  123.       /COPY ANZOBJCVN,SPGI0100
  124.       /COPY ANZOBJCVN,PGMI0100
  125.       /ENDIF
  126.  
  127.      D RTVOBSINFUDF    PR             1a
  128.      D  Library                      10a   const
  129.      D  Object                       10a   const
  130.      D  Type                          8a   const
  131.      D  Attribute                    10a   const
  132.  
  133.  
  134.      D RTVTGTRLSUDF    PR             6a
  135.      D  Library                      10a   const
  136.      D  Object                       10a   const
  137.      D  Type                          8a   const
  138.      D  Attribute                    10a   const
  139.  
  140.       /IF DEFINED(PROTOTYPESONLY)
  141.       /EOF
  142.       /ENDIF
  143.  
  144.      P RTVOBSINFUDF    B                   EXPORT
  145.      D RTVOBSINFUDF    PI             1a
  146.      D  Library                      10a   const
  147.      D  Object                       10a   const
  148.      D  Type                          8a   const
  149.      D  Attribute                    10a   const
  150.  
  151.      D ObservableItem  s              1a
  152.  
  153.       /free
  154.        if Type='*SRVPGM';
  155.          callp qbnrspgm(spgi0100:%len(SPGI0100):'SPGI0100':object+Library:
  156.                         errc0100);
  157.          if ExceptionId=*blanks;
  158.            ObservableItem=spgi0100.allcrtdata;
  159.          Else;
  160.            ObservableItem='9';
  161.          ENDIF;
  162.        Else; // not a service program
  163.          If type<>'*PGM';
  164.            ObservableItem='8';
  165.          Else;  // *PGM
  166.            callp qclrpgmi(pgmi0100:%len(pgmi0100):'PGMI0100':object+Library:
  167.                           errc0100);
  168.            if ExceptionId=*blanks;
  169.              if pgmi0100.ObservInf=*blanks;
  170.                ObservableItem=pgmi0100.AllCrtDta;
  171.              Else;
  172.                ObservableItem=pgmi0100.ObservInf;
  173.              EndIf;
  174.            Else;
  175.              ObservableItem='7';  // Error calling QCLRPGMI
  176.            EndIf;
  177.          EndIf;
  178.  
  179.        EndIf;
  180.  
  181.        return ObservableItem;
  182.       /end-free
  183.      P RTVOBSINFUDF    E
  184.  
  185.  
  186.      P RTVTGTRLSUDF    B                   EXPORT
  187.      D RTVTGTRLSUDF    PI             6a
  188.      D  Library                      10a   const
  189.      D  Object                       10a   const
  190.      D  Type                          8a   const
  191.      D  Attribute                    10a   const
  192.  
  193.      D TargetRelease   s              6a
  194.  
  195.       /free
  196.        if Type='*SRVPGM';
  197.          callp qbnrspgm(spgi0100:%len(SPGI0100):'SPGI0100':object+Library:
  198.                         errc0100);
  199.          if ExceptionId=*blanks;
  200.            TargetRelease=spgi0100.EarlstRelease;
  201.          Else;
  202.            TargetRelease='999999';
  203.          ENDIF;
  204.        Else; // not a service program
  205.          If type<>'*PGM';
  206.            TargetRelease='888888';
  207.          Else;  // *PGM
  208.            callp qclrpgmi(pgmi0100:%len(pgmi0100):'PGMI0100':object+Library:
  209.                           errc0100);
  210.            if ExceptionId=*blanks;
  211.              TargetRelease=pgmi0100.EarlRelRun;
  212.            Else;
  213.              TargetRelease='777777';  // Error calling QCLRPGMI
  214.            EndIf;
  215.          EndIf;
  216.  
  217.        EndIf;
  218.  
  219.        return TargetRelease;
  220.       /end-free
  221.      P RTVTGTRLSUDF    E 
  222.  
  223.  
  224. ---------------------------------------------------------------------------------------
  225. SPGI0100, Member 4 of 8:
  226.       /if not defined(SPGI0100)
  227.       /define SPGI0100
  228.       /include ROUTINES/QAPISRC,QBNRSPGM
  229.       * SPGI0100 - QBNRSPGM - Retrieve Service Program Information - Basic
  230.      D SPGI0100        DS                  qualified
  231.      D  BytesProvided                10i 0 inz(%len(SPGI0100))
  232.      D  BytesAvail                   10i 0 inz(*zeros)
  233.      D  PgmName                      10a   inz(*blanks)
  234.      D  PgmLib                       10a   inz(*blanks)
  235.      D  Owner                        10a   inz(*blanks)
  236.      D  PgmAttr                      10a   inz(*blanks)
  237.      D  CrtDateTime                  13a   inz(*all'0')
  238.      D   CrtDate                      7a   overlay(CrtDateTime)
  239.      D    CrtDateN                    7s 0 overlay(CrtDate)
  240.      D   CrtTime                      6a   overlay(CrtDateTime:*next)
  241.      D    CrtTimeN                    6s 0 overlay(CrtTime)
  242.      D   CrtDateTimeN                13s 0 overlay(CrtDateTime)
  243.      D  ExpSrcFile                   10a   inz(*blanks)
  244.      D  ExpSrcLib                    10a   inz(*blanks)
  245.      D  ExpSrcMbr                    10a   inz(*blanks)
  246.      D  ActGrpAttr                   30a   inz(*blanks)
  247.      D  ExpSignature                 16a   inz(*blanks)
  248.      D  UserProfile                   1a   inz(*blanks)
  249.      D  ObsInfCpr                     1a   inz(*blanks)
  250.      D  RTInfCpr                      1a   inz(*blanks)
  251.      D  CCSID                        10i 0 inz(*zeros)
  252.      D  NbrMod                       10i 0 inz(*zeros)
  253.      D  NbrSrvPgms                   10i 0 inz(*zeros)
  254.      D  NbrCopyRts                   10i 0 inz(*zeros)
  255.      D  TxtDesc                      50a   inz(*blanks)
  256.      D  SharedActGrp                  1a   inz(*blanks)
  257.      D  AlwUpdate                     1a   inz(*blanks)
  258.      D  UnrslvdRef                   10i 0 inz(*zeros)
  259.      D  UseAdoptAuth                  1a   inz(*blanks)
  260.      D  AlwBndLibNUpd                 1a   inz(*blanks)
  261.      D  ProfilingData                10a   inz(*blanks)
  262.      D  TeraEnabled                   1a   inz(*blanks)
  263.      D  StgModel                      1a   inz(*blanks)
  264.      D  Reserved1                    80a   inz(*allx'00')
  265.      D  State                         1a   inz(*blanks)
  266.      D  Domain                        1a   inz(*blanks)
  267.      D  AscSpaceSize                 10i 0 inz(*zeros)
  268.      D  StaticStgSize                10i 0 inz(*zeros)
  269.      D  SrvPgmSize                   10i 0 inz(*zeros)
  270.      D  CrtOnRelease                  6a   inz(*blanks)
  271.      D  EarlstRelease                 6a   inz(*blanks)
  272.      D  CrtForRelease                 6a   inz(*blanks)
  273.      D  AlwStcStgRInt                 1a   inz(*blanks)
  274.      D  ConvReqd                      1a   inz(*blanks)
  275.      D  AllCrtData                    1a   inz(*blanks)
  276.      D  Reserved2                    91a   inz(*blanks)
  277.      D  PagingPool                    1a   inz(*blanks)
  278.      D  PagingAmount                  1a   inz(*blanks)
  279.       /endif 
  280.  
  281.  
  282. ---------------------------------------------------------------------------------------
  283. QBNRSPGM, Member 5 of 8:
  284.       /if not defined(QBNRSPGM)
  285.       /define QBNRSPGM
  286.       * Retrieve Service Program Information
  287.      D QBNRSPGM        PR                  EXTPGM('QBNRSPGM')
  288.      D  RecVar                    32767A   OPTIONS(*VARSIZE)
  289.      D  RecVarLen                    10I 0 CONST
  290.      D  FormatName                    8A   CONST
  291.      D  PgmLib                       20A   CONST
  292.      D  ErrorCode                 32767A   options(*varsize)
  293.       /include ANZOBJCVN,ERRC0100
  294.       /endif 
  295.  
  296.  
  297. ---------------------------------------------------------------------------------------
  298. ERRC0100, Member 6 of 8:
  299.       /if not defined(ERRC0100)
  300.       /define ERRC0100
  301.       * ERRC0100 - Error code data structure
  302.      D ERRC0100        DS
  303.      D  BytesProvided                10I 0 INZ(%len(errc0100))
  304.      D  BytesAvail                   10I 0
  305.      D  ExceptionId                   7A
  306.      D  Reserved1                     1A
  307.      D  ExceptData                  250A
  308.      D ERRC0100P       S                   LIKE(ERRC0100)
  309.       /endif 
  310.  
  311.  
  312.  
  313. ---------------------------------------------------------------------------------------
  314. PGMI0100, Member 7 of 8:
  315.       /if not defined(PGMI0100)
  316.       /define PGMI0100
  317.       /include ANZOBJCVN,QCLRPGMI
  318.       * PGMI0100 - QCLRPGMI - Retrieve Program Information - Basic
  319.      D PGMI0100        DS                  qualified
  320.      D  BytesRet                     10I 0
  321.      D  BytesAvl                     10I 0
  322.       * Program creation information
  323.      D  PgmName                      10A
  324.      D  PgmLib                       10A
  325.      D  PgmOwner                     10A
  326.      D  PgmAtr                       10A
  327.      D  PgmCrtTS                     13A
  328.      D  SrcFilName                   10A
  329.      D  SrcFilLib                    10A
  330.      D  SrcFilMbr                    10A
  331.      D  SrcChgTS                     13A
  332.      D  ObservInf                     1A
  333.      D  UsrPrfOpt                     1A
  334.      D  UseAdoptAut                   1A
  335.      D  LogCLCmds                     1A
  336.      D  AlwRtvCLSrc                   1A
  337.      D  FixDecimDta                   1A
  338.      D  TxtDesc                      50A
  339.      D  PgmType                       1A
  340.      D  TeraspStg                     1A
  341.      D  Reserved1                    58A
  342.       * Program statistics information
  343.      D  MinNbrParms                  10I 0
  344.      D  MaxNbrParms                  10I 0
  345.      D  PgmSize                      10I 0
  346.      D  SpaceSize                    10I 0
  347.      D  StatStgSize                  10I 0
  348.      D  AutoStgSize                  10I 0
  349.      D  NbrMIInstr                   10I 0
  350.      D  NbrMIODT                     10I 0
  351.      D  PgmState                      1A
  352.      D  CompileInf                   14A
  353.      D  EarlRelRun                    6A
  354.      D  SortSeqTbl                   10A
  355.      D  SortSeqLib                   10A
  356.      D  LangID                       10A
  357.      D  PgmDomain                     1A
  358.      D  ConvReq                       1A
  359.      D  Reserved2                    20A
  360.       * Program performance information
  361.      D  Optimize                      1A
  362.      D  PagPool                       1A
  363.      D  UpdPASA                       1A
  364.      D  ClrPASA                       1A
  365.      D  PagAmt                        1A
  366.      D  Reserved3                    18A
  367.       * ILE information
  368.      D  PgmEntMod                    10A
  369.      D  PgmEntModLib                 10A
  370.      D  ActGrpAtr                    30A
  371.      D  ObservCmpr                    1A
  372.      D  RuntimCmpr                    1A
  373.      D  RelCrtOn                      6A
  374.      D  ShareActGrp                   1A
  375.      D  AlwUpd                        1A
  376.      D  PgmCCSID                     10I 0
  377.      D  NbrModules                   10I 0
  378.      D  NbrSrvPgms                   10I 0
  379.      D  NbrCopyrts                   10I 0
  380.      D  NbrUnresRefs                 10I 0
  381.      D  RelCrtFor                     6A
  382.      D  AlwStatInit                   1A
  383.      D  AllCrtDta                     1A
  384.      D  AlwBndLibUpd                  1A
  385.      D  ProfDta                      10A
  386.      D  TeraStgMod                    1A
  387.      D  StgModel                      1A
  388.      D  Reserved4                    87A
  389.       /endif 
  390.  
  391.  
  392. ---------------------------------------------------------------------------------------
  393. QCLRPGMI, Member 8 of 8:
  394.       /if not defined(QCLRPGMI)
  395.       /define QCLRPGMI
  396.       * Retrieve Program Information
  397.      D QCLRPGMI        PR                  EXTPGM('QCLRPGMI')
  398.      D  RecVar                    32767A   OPTIONS(*VARSIZE)
  399.      D  RecVarLen                    10I 0 CONST
  400.      D  FormatName                    8A   CONST
  401.      D  PgmLib                       20A   CONST
  402.      D  ErrorCode                 32767A   options(*varsize)
  403.       /include ANZOBJCVN,ERRC0100
  404.       /endif 
© 2004-2019 by midrange.com generated in 0.005s valid xhtml & css