//**** START OF SPECIFICATIONS *****************************************00010000 //* *00020000 //* MODULE NAME = APSUC07U *00030000 //* $MOD (APSUC07U) COMP(APS) PROD(PSF) : VERSION 3.3.0 *00040000 //* *00050000 //* DESCRIPTIVE NAME = RESOURCE EXIT - SAMPLE 7 *00060000 //* *00070000 //* STATUS = VERSION 3, RELEASE 3, LEVEL 0 *00080000 //* *00090000 //* FUNCTION = *00100000 //* *00110000 //* This is installation exit APSUX07U written in C. *00120000 //* *00130000 //* This exit performs two functions: *00140000 //* *00150000 //* 1. Force load of all FORMDEFs and PAGEDEFs from DASD. The *00160000 //* PSF in-storage copy will never be used. *00170000 //* *00180000 //* 2. For all accessed PAGEDEFs, FORMDEFs, OVERLAYs, and PAGE *00190000 //* SEGMENTs, the object name is altered if the dataset being *00200000 //* processed is a "production" dataset. Production datasets *00210000 //* are flagged by having PRMODE=UPROD in their JCL. *00220000 //* *00230000 //* The alteration made to the resource name is to place a $ in *00240000 //* the second character position. For instance, PAGEDEF *00250000 //* P1ABCD would have its name changed to P$ABCD. Since the *00260000 //* PAGEDEF that is named P$ABCD cannot be accessed directly *00270000 //* through JCL (i.e. coding PAGEDEF=ABCD results in a reference *00280000 //* to the P1ABCD object), this exit ensures that objects *00290000 //* with the $ in their second character are only accessible to *00300000 //* production jobs. *00310000 //* *00320000 //* This means that a development copy of PAGEDEF ABCD can *00330000 //* coexist with the production copy and they can be used *00340000 //* concurrently. Test jobs will access P1ABCD and production *00350000 //* will access P$ABCD. FORMDEFs, OVERLAYs, and PAGE SEGMENTs *00360000 //* are treated the same way. *00370000 //* *00380000 //* *00390000 //* NOTE: Implicit in this approach is the fact that ALL *00400000 //* production resource objects must have the production *00410000 //* prefix. This has two ramifications: standard PSF *00420000 //* objects (e.g. F1010110), if used by a production job *00430000 //* must have a copy bearing the production prefix; and *00440000 //* test jobs using a mix of production and test objects *00450000 //* must have an available test copy of all production *00460000 //* objects. *00470000 //* *00480000 //* *00490000 //* This exit is first entered on PSF initialization. On this entry *00500000 //* the exit sets flags in the XTP7NACC field to indicate that it *00510000 //* wants control whenever a PAGEDEF, FORMDEF, OVERLAY, or PAGE *00520000 //* SEGMENT is accessed. On subsequent entries the logic discussed *00530000 //* above is executed. *00540000 //* *00550000 //* NOTES = SEE BELOW: *00560000 //* DEPENDENCIES = NONE *00570000 //* RESTRICTIONS = NONE *00580000 //* *00590000 //* MODULE TYPE = PROCEDURE *00600000 //* PROCESSOR = C *00610000 //* ATTRIBUTES = REENTRANT *00620000 //* AMODE 31 *00630000 //* RMODE ANY *00640000 //* *00650000 //* ENTRY POINT = APSUC07 *00660000 //* *00670000 //* REGISTER ON ENTRY : *00680000 //* One parameter which is the address of APSGEXTP is passed *00690000 //* *00700000 //* INPUT = PARAMETER AREA (APSGEXTP) *00710000 //* *00720000 //* OUTPUT = N/A *00730000 //* EXIT-NORMAL = RETURN TO CALLER *00740000 //* EXIT-ERROR = NONE *00750000 //* *00760000 //* EXTERNAL REFERENCES = SEE BELOW: *00770000 //* ROUTINES = *00780000 //* DATA AREAS = NONE *00790000 //* CONTROL BLOCKS = (SEE MACROS LISTED BELOW) *00800000 //* *00810000 //* TABLES = NONE *00820000 //* *00830000 //* MACROS = MACROS USED FROM MACRO LIBRARY: *00840000 //* APSGEXTP - PSF INSTALLATION EXIT PARAMETER AREA *00850000 //* APSUECA - PSF EXIT COMMUNICATIONS AREA *00860000 //* APSURLST - PSF EXIT RESOURCE LIST AREA *00870000 //* *00880000 //* CHANGE ACTIVITY = *00890000 //* $B0=LAPS0008, HPRF320, 990929, BDKUAJT: Initial Version @B0A*00900000 //* $EV=LAPS0009,HPRF330,010530,BUQ4RLB: Version 3.3.0 @EVA*00910000 //* *00920000 //**** END OF SPECIFICATIONS *******************************************00930000 00940000 #pragma comment(date) 00950000 #pragma csect(CODE,"$APSUC07") 00960000 #pragma csect(STATIC,"#APSUC07") 00970000 #pragma linkage(APSUC07,OS) 00980000 #pragma runopts(TRAP(OFF)) 00990000 #pragma map(apsuc07,"APSUC07") 01000000 01010000 /*----------------------------------------------------------------------01020000 #include the following header files for struct definitions: 01030000 ----------------------------------------------------------------------*/01040000 01050000 #include // for function strcmp() 01060000 #include "apsgextc.h" 01070000 #include "apsurlsc.h" 01080000 #include "apsuecac.h" 01090000 01100000 /*----------------------------------------------------------------------01110000 Declarations 01120000 ----------------------------------------------------------------------*/01130000 01140000 int i; // Loop variable 01150000 int len = 8; // Length of the PRMODE keyword 01160000 APSURLST * rlstptr; // Pointer to an RLST entry 01170000 01180000 /*----------------------------------------------------------------------01190000 Constants 01200000 ----------------------------------------------------------------------*/01210000 01220000 #define PRODJOB "UPROD " 01230000 01240000 01250000 void apsuc07(APSGEXTP * xtpptr) 01260000 { 01270000 01280000 /*--------------------------------------------------------------------- 01290000 Determine what type of call is being made to the exit 01300000 ---------------------------------------------------------------------*/ 01310000 01320000 switch (xtpptr->XTPRECP.XTPRECP7->XTP7ETYP) // Select on the 01330000 // type of call 01340000 { 01350000 case XTP7INIT: // Initialization call 01360000 01370000 /*------------------------------------------------------------- 01380000 INITIALIZATION ROUTINE: 01390000 (entered only during PSF initialization) 01400000 - Request control at access time for formdefs, pagedefs, 01410000 page segments, and overlays 01420000 -------------------------------------------------------------*/ 01430000 01440000 xtpptr->XTPRECP.XTPRECP7->XTP7NOTY.XTP7NACC = XTP7AFD + 01450000 XTP7APD + XTP7APS + XTP7AMO; // Request control 01460000 // at access time 01470000 // for formdefs, 01480000 // pagedefs, page 01490000 // segments, and 01500000 // overlays 01510000 01520000 break; 01530000 01540000 case XTP7ACC: // Resource access call 01550000 01560000 /*---------------------------------------------------------------01570000 ACCESS ROUTINE 01580000 - Check dataset type and don't process headers, trailers, or 01590000 message data sets. 01600000 - Set RLSTLOAD flag to force pagedef or formdef load from DASD.01610000 - If job's PRMODE = UPROD, then set production flag in resource01620000 name, otherwise exit leaving name untouched. This means 01630000 production jobs use resources with names that cannot be coded01640000 in JCL or overlays. This ensures that test and development 01650000 objects do not have names that conflict with production 01660000 object names. 01670000 ----------------------------------------------------------------*/01680000 01690000 if (xtpptr->XTPRECP.XTPRECP7->XTP7DSAT & (XTP7PDFT + XTP7PJHD 01700000 + XTP7PJTR + XTP7PDSH // Test flags for 01710000 + XTP7PMDS)) // non-user dataset 01720000 01730000 ; // Do nothing with non-user 01740000 // dataset 01750000 else // User dataset 01760000 { 01770000 if (xtpptr->XTPRECP.XTPRECP7->XTP7RTYP & (XTP7PD + 01780000 XTP7FD)) // If the resource is 01790000 // a pagedef or formdef:01800000 01810000 xtpptr->XTPRECP.XTPRECP7->XTP7RLST.XTP7LSTP-> 01820000 RLSTFLGS.RLSTAFLG |= RLSTLOAD; 01830000 // Request pagedef or 01840000 // formdef load from 01850000 // DASD. 01860000 01870000 01880000 if (memcmp(xtpptr->XTPECAP->ECABASE.ECAECEP->ECEPRMD, 01890000 PRODJOB, len)) 01900000 // If job's PRMODE 01910000 // indicates a 01920000 // production job 01930000 ; // Do nothing if not a 01940000 // production job 01950000 else // A production job 01960000 { 01970000 /*------------------------------------------------------ 01980000 Pagedefs and formdefs only have one RLST entry, but 01990000 there may be multiple overlays or page segments so 02000000 we have to work down the RLST chain to get all objects. 02010000 -------------------------------------------------------*/ 02020000 02030000 rlstptr = xtpptr->XTPRECP.XTPRECP7->XTP7RLST.XTP7LSTP; 02040000 // Point to 1st RLST 02050000 // entry in the chain 02060000 02070000 for(i = xtpptr->XTPRECP.XTPRECP7->XTP7RLST.XTP7LSTC; 02080000 i > 0; --i) 02090000 // Loop for the # of 02100000 // RLST entries in 02110000 // the chain 02120000 { 02130000 /*--------------------------------------------------- 02140000 Change second character of resource name to '$' 02150000 to ensure resource is accessed from production 02160000 library. 02170000 ---------------------------------------------------*/ 02180000 02190000 rlstptr->RLSTRID.RLSTNAMEŬ1¨ = '$'; 02200000 // Alter the resource 02210000 // name 02220000 02230000 rlstptr->RLSTFLGS.RLSTAFLG |= RLSTSMSG; 02240000 // Issue a 02250000 // substitution 02260000 // message 02270000 02280000 rlstptr = rlstptr->RLSTPTRS.RLSTNEXT; 02290000 // Point to next 02300000 // RLST entry 02310000 } // end loop for RLST entries 02320000 } // end else a production job 02330000 } // end else a user dataset 02340000 02350000 break; 02360000 02370000 default: // No match found - error 02380000 break; 02390000 } // End of select on the 02400000 // type of call 02410000 02420000 return; // Return with no error 02430000 } // End of main routine 02440000 02450000 02460000