Code:
- ---------------------------------------------------------------------------------------
- README, Member 1 of 8:
- Replace all occurences of library ROB with whatever you wish your
- *CURLIB to be in member SETUP. Some SQL stuff will not accept *CURLIB.
-
- Run the following commands:
- CHGCURLIB libraryContainingSourceFileANZOBJCVN
- RUNSQLSTM SRCFILE(ROB/ANZOBJCVN) SRCMBR(SETUP) COMMIT(*NONE)
-
-
- ---------------------------------------------------------------------------------------
- SETUP, Member 2 of 8:
- -- Set of SQL Statements to create custom ANZOBJCVN
-
- -- Run this with:
- -- RUNSQLSTM SRCFILE(ROB/ANZOBJCVN) SRCMBR(SETUP) COMMIT(*NONE)
-
- -- Step one: Create module to be part of service program
- CALL QCMDEXC (
- 'CRTRPGMOD MODULE(*CURLIB/RTVOBSINF) SRCFILE(*CURLIB/ANZOBJCVN)',62);
-
- -- Create service program to use this module
- CALL QCMDEXC (
- 'CRTSRVPGM SRVPGM(RTVOBSINF) EXPORT(*ALL)',40);
-
- -- Create User Defined Function, or UDF, to call the two subprocedures
- -- in this service program
- CREATE FUNCTION RTVOBSINFUDF (
- CHAR(10) ,
- CHAR(10) ,
- CHAR(8) ,
- CHAR(10) )
- RETURNS CHAR(1)
- LANGUAGE RPGLE
- SPECIFIC RTVOBSINFUDF
- DETERMINISTIC
- NO SQL
- RETURNS NULL ON NULL INPUT
- NO EXTERNAL ACTION
- EXTERNAL NAME 'ROB/RTVOBSINF(RTVOBSINFUDF)'
- PARAMETER STYLE GENERAL;
-
- CREATE FUNCTION RTVTGTRLSUDF (
- CHAR(10) ,
- CHAR(10) ,
- CHAR(8) ,
- CHAR(10) )
- RETURNS CHAR(6)
- LANGUAGE RPGLE
- SPECIFIC RTVTGTRLSUDF
- DETERMINISTIC
- NO SQL
- RETURNS NULL ON NULL INPUT
- NO EXTERNAL ACTION
- EXTERNAL NAME 'ROB/RTVOBSINF(RTVTGTRLSUDF)'
- PARAMETER STYLE GENERAL;
-
- CALL QCMDEXC (
- 'DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*PGM *SRVPGM) OUTPUT(*OUTFILE)
- OUTFILE(*CURLIB/DSPOBJDOUT)',104);
- -- 34567891123456789212345678931234567894123456789512345678961234567897123456789
- -- 3456789912345678901234567892
- -- Continuation assumes to end of the 80 character line. Drop the first
- -- character for the leading apostrophe. Leaving 79 useful characters on the
- -- first line.
-
- CREATE TABLE QTEMP/FIRSTPASS AS (
- SELECT ODLBNM AS LIBRARY,
- ODOBNM AS OBJECT,
- ODOBTP AS TYPE,
- ODOBAT AS ATTRIBUTE,
- RTVTGTRLSUDF(ODLBNM, ODOBNM, ODOBTP, ODOBAT) AS TARGETRELEASE,
- RTVOBSINFUDF(ODLBNM, ODOBNM, ODOBTP, ODOBAT) AS OBSERVABLEINFO,
- ODOBOW AS OBJECTOWNER,
- ODCRTU AS CREATEDBY
- FROM DSPOBJDOUT
- ORDER BY ODLBNM, ODOBNM)
- WITH DATA;
-
- CREATE TABLE FIXTHESE AS (
- SELECT LIBRARY, OBJECT, TYPE, ATTRIBUTE, TARGETRELEASE, OBSERVABLEINFO,
- OBJECTOWNER, CREATEDBY
- FROM QTEMP/FIRSTPASS
- WHERE OBSERVABLEINFO NOT IN('1', 'A')
- AND (TARGETRELEASE NOT BETWEEN 'V5' AND 'V9')
- ORDER BY LIBRARY, OBJECT)
- WITH DATA;
-
- DROP TABLE QTEMP/FIRSTPASS;
-
- ---------------------------------------------------------------------------------------
- RTVOBSINF, Member 3 of 8:
- /IF NOT DEFINED(PROTOTYPESONLY)
- // Retrieve program observability
- // As part of Power 6 upgrade you need to know if you have:
- // ILE programs or service programs that 'All creation data' = no
- // OPM programs that have 'Observable information' = *NONE
-
- // Service programs and ILE programs:
- // 0 *NO. Not all of the creation data is present. The creation template
- // program object could be missing or at least one of the modules in t
- // does not have creation data. The Display Service Program (DSPSRVPGM
- // *MODULE specified as the value for the DETAIL parameter can be used
- // module has creation data.
- // 1 *YES. The ILE service program has all creation data and all of that
- // 2 *UNOBS. The ILE service program has all creation data but not all o
- // observable.
-
- // OPM programs:
- // A *ALL. The program has all creation data and that data is observable
- // N *NONE. The program does not have all creation data.
- // U *UNOBS. The program has all creation data but not all of that data
- // Blank. The program is an ILE program.
-
- // Error conditions:
- // 9 Error calling retrieve service program api. See ExceptionId.
- // 8 Object is neither a *PGM or a *SRVPGM.
- // 7 Error calling retrieve program api. See ExceptionId.
-
-
- H NOMAIN
-
- /COPY ANZOBJCVN,SPGI0100
- /COPY ANZOBJCVN,PGMI0100
- /ENDIF
-
- D RTVOBSINFUDF PR 1a
- D Library 10a const
- D Object 10a const
- D Type 8a const
- D Attribute 10a const
-
-
- D RTVTGTRLSUDF PR 6a
- D Library 10a const
- D Object 10a const
- D Type 8a const
- D Attribute 10a const
-
- /IF DEFINED(PROTOTYPESONLY)
- /EOF
- /ENDIF
-
- P RTVOBSINFUDF B EXPORT
- D RTVOBSINFUDF PI 1a
- D Library 10a const
- D Object 10a const
- D Type 8a const
- D Attribute 10a const
-
- D ObservableItem s 1a
-
- /free
- if Type='*SRVPGM';
- callp qbnrspgm(spgi0100:%len(SPGI0100):'SPGI0100':object+Library:
- errc0100);
- if ExceptionId=*blanks;
- ObservableItem=spgi0100.allcrtdata;
- Else;
- ObservableItem='9';
- ENDIF;
- Else; // not a service program
- If type<>'*PGM';
- ObservableItem='8';
- Else; // *PGM
- callp qclrpgmi(pgmi0100:%len(pgmi0100):'PGMI0100':object+Library:
- errc0100);
- if ExceptionId=*blanks;
- if pgmi0100.ObservInf=*blanks;
- ObservableItem=pgmi0100.AllCrtDta;
- Else;
- ObservableItem=pgmi0100.ObservInf;
- EndIf;
- Else;
- ObservableItem='7'; // Error calling QCLRPGMI
- EndIf;
- EndIf;
-
- EndIf;
-
- return ObservableItem;
- /end-free
- P RTVOBSINFUDF E
-
-
- P RTVTGTRLSUDF B EXPORT
- D RTVTGTRLSUDF PI 6a
- D Library 10a const
- D Object 10a const
- D Type 8a const
- D Attribute 10a const
-
- D TargetRelease s 6a
-
- /free
- if Type='*SRVPGM';
- callp qbnrspgm(spgi0100:%len(SPGI0100):'SPGI0100':object+Library:
- errc0100);
- if ExceptionId=*blanks;
- TargetRelease=spgi0100.EarlstRelease;
- Else;
- TargetRelease='999999';
- ENDIF;
- Else; // not a service program
- If type<>'*PGM';
- TargetRelease='888888';
- Else; // *PGM
- callp qclrpgmi(pgmi0100:%len(pgmi0100):'PGMI0100':object+Library:
- errc0100);
- if ExceptionId=*blanks;
- TargetRelease=pgmi0100.EarlRelRun;
- Else;
- TargetRelease='777777'; // Error calling QCLRPGMI
- EndIf;
- EndIf;
-
- EndIf;
-
- return TargetRelease;
- /end-free
- P RTVTGTRLSUDF E
-
-
- ---------------------------------------------------------------------------------------
- SPGI0100, Member 4 of 8:
- /if not defined(SPGI0100)
- /define SPGI0100
- /include ROUTINES/QAPISRC,QBNRSPGM
- * SPGI0100 - QBNRSPGM - Retrieve Service Program Information - Basic
- D SPGI0100 DS qualified
- D BytesProvided 10i 0 inz(%len(SPGI0100))
- D BytesAvail 10i 0 inz(*zeros)
- D PgmName 10a inz(*blanks)
- D PgmLib 10a inz(*blanks)
- D Owner 10a inz(*blanks)
- D PgmAttr 10a inz(*blanks)
- D CrtDateTime 13a inz(*all'0')
- D CrtDate 7a overlay(CrtDateTime)
- D CrtDateN 7s 0 overlay(CrtDate)
- D CrtTime 6a overlay(CrtDateTime:*next)
- D CrtTimeN 6s 0 overlay(CrtTime)
- D CrtDateTimeN 13s 0 overlay(CrtDateTime)
- D ExpSrcFile 10a inz(*blanks)
- D ExpSrcLib 10a inz(*blanks)
- D ExpSrcMbr 10a inz(*blanks)
- D ActGrpAttr 30a inz(*blanks)
- D ExpSignature 16a inz(*blanks)
- D UserProfile 1a inz(*blanks)
- D ObsInfCpr 1a inz(*blanks)
- D RTInfCpr 1a inz(*blanks)
- D CCSID 10i 0 inz(*zeros)
- D NbrMod 10i 0 inz(*zeros)
- D NbrSrvPgms 10i 0 inz(*zeros)
- D NbrCopyRts 10i 0 inz(*zeros)
- D TxtDesc 50a inz(*blanks)
- D SharedActGrp 1a inz(*blanks)
- D AlwUpdate 1a inz(*blanks)
- D UnrslvdRef 10i 0 inz(*zeros)
- D UseAdoptAuth 1a inz(*blanks)
- D AlwBndLibNUpd 1a inz(*blanks)
- D ProfilingData 10a inz(*blanks)
- D TeraEnabled 1a inz(*blanks)
- D StgModel 1a inz(*blanks)
- D Reserved1 80a inz(*allx'00')
- D State 1a inz(*blanks)
- D Domain 1a inz(*blanks)
- D AscSpaceSize 10i 0 inz(*zeros)
- D StaticStgSize 10i 0 inz(*zeros)
- D SrvPgmSize 10i 0 inz(*zeros)
- D CrtOnRelease 6a inz(*blanks)
- D EarlstRelease 6a inz(*blanks)
- D CrtForRelease 6a inz(*blanks)
- D AlwStcStgRInt 1a inz(*blanks)
- D ConvReqd 1a inz(*blanks)
- D AllCrtData 1a inz(*blanks)
- D Reserved2 91a inz(*blanks)
- D PagingPool 1a inz(*blanks)
- D PagingAmount 1a inz(*blanks)
- /endif
-
-
- ---------------------------------------------------------------------------------------
- QBNRSPGM, Member 5 of 8:
- /if not defined(QBNRSPGM)
- /define QBNRSPGM
- * Retrieve Service Program Information
- D QBNRSPGM PR EXTPGM('QBNRSPGM')
- D RecVar 32767A OPTIONS(*VARSIZE)
- D RecVarLen 10I 0 CONST
- D FormatName 8A CONST
- D PgmLib 20A CONST
- D ErrorCode 32767A options(*varsize)
- /include ANZOBJCVN,ERRC0100
- /endif
-
-
- ---------------------------------------------------------------------------------------
- ERRC0100, Member 6 of 8:
- /if not defined(ERRC0100)
- /define ERRC0100
- * ERRC0100 - Error code data structure
- D ERRC0100 DS
- D BytesProvided 10I 0 INZ(%len(errc0100))
- D BytesAvail 10I 0
- D ExceptionId 7A
- D Reserved1 1A
- D ExceptData 250A
- D ERRC0100P S LIKE(ERRC0100)
- /endif
-
-
-
- ---------------------------------------------------------------------------------------
- PGMI0100, Member 7 of 8:
- /if not defined(PGMI0100)
- /define PGMI0100
- /include ANZOBJCVN,QCLRPGMI
- * PGMI0100 - QCLRPGMI - Retrieve Program Information - Basic
- D PGMI0100 DS qualified
- D BytesRet 10I 0
- D BytesAvl 10I 0
- * Program creation information
- D PgmName 10A
- D PgmLib 10A
- D PgmOwner 10A
- D PgmAtr 10A
- D PgmCrtTS 13A
- D SrcFilName 10A
- D SrcFilLib 10A
- D SrcFilMbr 10A
- D SrcChgTS 13A
- D ObservInf 1A
- D UsrPrfOpt 1A
- D UseAdoptAut 1A
- D LogCLCmds 1A
- D AlwRtvCLSrc 1A
- D FixDecimDta 1A
- D TxtDesc 50A
- D PgmType 1A
- D TeraspStg 1A
- D Reserved1 58A
- * Program statistics information
- D MinNbrParms 10I 0
- D MaxNbrParms 10I 0
- D PgmSize 10I 0
- D SpaceSize 10I 0
- D StatStgSize 10I 0
- D AutoStgSize 10I 0
- D NbrMIInstr 10I 0
- D NbrMIODT 10I 0
- D PgmState 1A
- D CompileInf 14A
- D EarlRelRun 6A
- D SortSeqTbl 10A
- D SortSeqLib 10A
- D LangID 10A
- D PgmDomain 1A
- D ConvReq 1A
- D Reserved2 20A
- * Program performance information
- D Optimize 1A
- D PagPool 1A
- D UpdPASA 1A
- D ClrPASA 1A
- D PagAmt 1A
- D Reserved3 18A
- * ILE information
- D PgmEntMod 10A
- D PgmEntModLib 10A
- D ActGrpAtr 30A
- D ObservCmpr 1A
- D RuntimCmpr 1A
- D RelCrtOn 6A
- D ShareActGrp 1A
- D AlwUpd 1A
- D PgmCCSID 10I 0
- D NbrModules 10I 0
- D NbrSrvPgms 10I 0
- D NbrCopyrts 10I 0
- D NbrUnresRefs 10I 0
- D RelCrtFor 6A
- D AlwStatInit 1A
- D AllCrtDta 1A
- D AlwBndLibUpd 1A
- D ProfDta 10A
- D TeraStgMod 1A
- D StgModel 1A
- D Reserved4 87A
- /endif
-
-
- ---------------------------------------------------------------------------------------
- QCLRPGMI, Member 8 of 8:
- /if not defined(QCLRPGMI)
- /define QCLRPGMI
- * Retrieve Program Information
- D QCLRPGMI PR EXTPGM('QCLRPGMI')
- D RecVar 32767A OPTIONS(*VARSIZE)
- D RecVarLen 10I 0 CONST
- D FormatName 8A CONST
- D PgmLib 20A CONST
- D ErrorCode 32767A options(*varsize)
- /include ANZOBJCVN,ERRC0100
- /endif
|
|