SMF Step-Level Account Code Specification
The global account code exit routine, ACCTRTE, described in the previous section, sets account codes (ACCTNOx) for every
MICS
database observation written for the job, TSO session, started task, or address space records from an APPC/MVS Transaction Program (TP).micsrm140
The global account code exit routine, ACCTRTE, described in the previous section, sets account codes (ACCTNOx) for every
MICS
database observation written for the job, TSO session, started task, or address space records from an APPC/MVS Transaction Program (TP).Some sites allow account code specification in the JCL EXEC statement for individual program steps. Other sites want to set account codes based on the program executed. The ACCTRTE is only executed once for a given address space. The account code values set in ACCTRTE rely on job-level information.
MICS
enables you to override the global ACCTNOx account code values for each step or interval record prior to output to the MICS
step-level files.Step-level account code modification is performed in the USRSPGM exit. This exit is invoked once for each step or interval record for a job, task, session, or APPC/MVS TP.
Before invoking the USRSPGM exit,
MICS
saves the account code (ACCTNOx) values set in the ACCTRTE. You may change the value of one or more ACCTNOx account codes in the USRSPGM exit and the new values will be used for that particular BATPGM, BAT_TS, BAT_ST, or BAT_TP observation. Once the step-level observation is written, MICS
restores the ACCTNOx values back to the original values set in ACCTRTE.The job card account fields are read from the SMF initiation or job termination records and stored in the ACTFLDx data elements. Most step-level accounting schemes rely on account fields specified on the JCL EXEC statement for individual steps. To set step-level ACCTNOx values based on these step-level account fields, make a modification to
MICS
.Note:
Implementation of any exit or modification should be made through the MICS
test database unit or test complex. If you use the test complex, it must be at the same maintenance level as your production complex. Implement the change, check the change thoroughly, and then move the change to the production shared libraries. This is a complex modification. If you have questions about the implementation or effects of this complex modification, contact Broadcom Support
t for assistance before you begin.Modifying MICS to Read and Save Step-level Account Fields
MICS
to Read and Save Step-level Account FieldsTo have account codes from the JCL EXEC statements of individual steps available for the step-level ACCTNOx setting, follow these steps:
- Update sharedprefix.MICS.GENLIB(SMFGENIN) to add the step accounting fields to the two step record suspension intermediate files, BATSFS and BATSFC. The data element names used are SACTFLD1-5. The addition is accomplished by adding data element descriptions for the new elements in these files in sharedprefix.MICS.GENLIB(SMFGENIN).Perform this step using the IEBUPDTE statements listed below.The FILE statements for the step suspend files are:FILE SFS 02 1 Y N N N N N N N Step/Interval Record...15904000 FILE SFC 02 1 Y N N N N N N N Step Continuation Re...16404000Add TYPE and NAME statements for the SACTFLDx data elements using the IEBUPDTE code shown below. These additions will be inserted in the User Modification areas for the BATSFS and BATSFC files.Note:Make sure you move the 8 digit sequence numbers to columns 73-80 before executing the IEBUPDTE code://xxx JOB (your job card) //STEP1 EXEC PGM=IEBUPDTE //SYSPRINT DD SYSOUT=A //SYSUT1 DD DISP=SHR,DSN=sharedprefix.MICS.GENLIB //SYSUT2 DD DISP=OLD,DSN=sharedprefix.MICS.GENLIB //SYSIN DD * ./ CHANGE NAME=SMFGENIN TYPE R $20 . $20 . $20 . 16310000 NAME SACTFLD1 00 0 N N N N Step Account Field 1 16310100 NAME SACTFLD2 00 0 N N N N Step Account Field 2 16310120 NAME SACTFLD3 00 0 N N N N Step Account Field 3 16310130 NAME SACTFLD4 00 0 N N N N Step Account Field 4 16310140 NAME SACTFLD5 00 0 N N N N Step Account Field 5 16310150 TYPE R $20 . $20 . $20 . 16710000 NAME SACTFLD1 00 0 N N N N Step Account Field 1 16710100 NAME SACTFLD2 00 0 N N N N Step Account Field 2 16710120 NAME SACTFLD3 00 0 N N N N Step Account Field 3 16710130 NAME SACTFLD4 00 0 N N N N Step Account Field 4 16710140 NAME SACTFLD5 00 0 N N N N Step Account Field 5 16710150 ./ ENDUP
- Regenerate the product by submitting the job in sharedprefix.MICS.CNTL(SMFCGEN). This job will construct SMF support routines that include the data elements on the BATSFS and BATSFC files.
- Copy sharedprefix.MICS.SOURCE(#SMFEXIT) to the same named member of sharedprefix.MICS.TEST.SOURCE.
- Add the _USRSSFS macro code listed below to the _USRSSFS macro in sharedprefix.MICS.TEST.SOURCE(#SMFEXIT). The modification links to ACCTBLD, and is inserted through the standard file manipulation exit (USRSSFS) for the Step Suspension (BATSFS) and the Step Continuation (BATSFC) files.
- The new code causes the extraction of account fields from SMF type 30 interval/step end records.
- ACCTBLD reads the SMF fields into data elements ACTFLD1-ACTFLD5. The inserted logic must reassign these values into other data elements (SACTFLD1-5) so that the ACTFLD data elements will not overlay step values.MACRO _USRSSFS ... (existing exit code, if any) * LOGIC TO PROCESS STEP ACCOUNTING INFORMATION; IF T30ACOFF AND T30ACSEG THEN DO; T30ACOFF = T30ACOFF - 3; COL = T30ACOFF; NUMACT = T30ACSEG; END; ELSE NUMACT = 0; IF NUMACT GT 0 THEN DO; LINK ACCTBLD; SACTFLD1 = ACTFLD1; SACTFLD2 = ACTFLD2; SACTFLD3 = ACTFLD3; SACTFLD4 = ACTFLD4; SACTFLD5 = ACTFLD5; END; ELSE DO; SACTFLD1 = ' '; SACTFLD2 = ' '; SACTFLD3 = ' '; SACTFLD4 = ' '; SACTFLD5 = ' '; END; ... %
Overriding Global Acctnox Values for Each Step or Interval
To override ACCTNOx values set in the ACCTRTE, follow the steps listed below:
- Modify the _USRSPGM macro code in #SMFEXIT to add logic to modify the account level data elements ACCTNO1 to ACCTNOx for the step-level files. To do this, use the step accounting fields you have saved or any other step-level information that identifies ownership of the activity. The SACTFLD1-5 data elements and any other step-level data elements contained in the BATPGM file are available.You may only want to set step-level account codes for a particular address space type, such as started tasks. You can use the data element PGMTYPE to determine the type of step record currently in process.PGMTYPE=1 - Batch PGMTYPE=2 - TSO Session PGMTYPE=3 - Started Task PGMTYPE=4 - APPC/MVS Transaction Program PGMTYPE=5 - Open Edition/MVS PGMTYPE=6 - System Address SpaceAn example of a step-level accounting routine that only overrides the global account codes for started tasks is shown below.MACRO _USRSPGM ... (existing exit code, if any) IF PGMTYPE = '3' THEN DO; IF SACTFLD1 NE ' ' THEN ACCTNO1=SACTFLD1 ; IF SACTFLD2 NE ' ' THEN ACCTNO2=SACTFLD2 ; ... (logic appropriate to your purpose) END; ... %Note that the global ACCTNO3 account code is unchanged. Also, ACCTNO1 and ACCTNO2 are only overridden if step-level account codes (SACTFLDx) are non-blank, and the program type indicates a started task (PGMTYPE=3).
- Execute aMICS DAILYjob on the test database unit. Provide test input data that has a variety of step records on the SMF log with different step account field contents.
- Examine the affected areas of theMICStest database completely. For a good comparison, examine data from a similar run without the modification. Make any corrections needed, and retest until the desired results are obtained.
- After testing is complete, move the SMF exit member to sharedprefix.MICS.SOURCE in your production complex.