+

Search Tips   |   Advanced Search

z/OS: Job usage data for charge-back accounting support</h2> <p> The product provides charge-back accounting information for batch jobs for all operating systems. Use charge-back accounting to determine the computing costs of batch job execution for work that has been performed by various users and groups. </p> <p> The <a href="http://setgetweb.com/p/WAS9/ae/was3381.html">job scheduler</a> records usage data for charge-back accounting when enabled through the administrative console. This function is available for all operating systems and can be enabled and disabled through configuration settings. Job usage information is not enabled by default. </p> <p> Accounting information for each job includes: <p> <ul> <li>Job identity: The job identifier associated with the job, which is returned by the <a href="http://setgetweb.com/p/WAS9/ae/was3381.html">job scheduler</a> when the job is submitted <li>Submitter identity: The identity (if any) of the submitter of the job <p><li>CPU used: <p> <ul> <p><li> An integer that is the number of units of CPU used, where one unit is 10<sup class="ph sup">-6</sup> second. <p><li> A value in the time of day (TOD) clock format, which is 64 bits. To obtain a value in microseconds, divide the TOD clock format value by 4096, and then divide that value by 1000. For example, if the TOD value retrieved from the table is 433064553000, then the following formula converts the TOD value into microseconds: <pre>433064553000 / (4096*1000) = 105728.650634765625 microseconds </pre> </ul><p> <li>Job state: The state of the job. That is, running or ended. <li>Node name and server name: The node and server names where the job ran <li>Job start time: The time the job began to run <li>Last update time: The time of the last job usage update <li>Accounting string: The job accounting information associated with the job </ul><p> <p> The DDL statements for the <a href="http://setgetweb.com/p/WAS9/ae/was3381.html">job scheduler</a> JOBUSAGE table are defined in the CreateLRSCHEDTables*.ddl files of the app_server_root/util/Batch directory. An example schema definition is: <pre>CREATE TABLE "LRSSCHEMA"."JOBUSAGE" ( "JOBID" VARCHAR(250) NOT NULL, "SUBMITTER" VARCHAR(256), "CPUCONSUMEDSOFAR" BIGINT NOT NULL, "JOBSTATE" VARCHAR(32) NOT NULL, "SERVER" VARCHAR(250) NOT NULL, "NODE" VARCHAR(250) NOT NULL, "STARTTIME" VARCHAR(64) NOT NULL, "LASTUPDATE" VARCHAR(64) NOT NULL, "ACCNTING" CHAR(64) ) IN "USERSPACE1" ; </pre> <p> The table data can be accessed with an SQL query, for example: <pre>select * from LRSSCHEMA.JOBUSAGE where JOBID='PostingSampleEar:99' </pre> <p> Programmatic access to the scheduler job usage table data must specify an isolation level of read uncommitted, to impede active job execution or the recording of accounting data. The STARTTIME and LASTUPDATE represent the return value of System.currentTimeMillis(). See ++ in the following information for more detail.</p> <p><br><h3> (ZOS) Job usage SMF record layout</h3> <p> The purpose of the JobUsage SMF record is to record information about a batch container job inside a WebSphere Application Server for z/OS transaction server. The SMF type 120 record, subtype 20, is the job usage record. There is one job usage section per record as shown in the following table:</p> <p> <p> <p><table cellpadding=5 border=1> <!-- <caption>Table 1. Job usage SMF record layout. The table includes the offset in decimal, the offset in hexadecimal, the name, the length, the format, and a description.</caption> --> <tr><th align=left>Offset (decimal) <th align=left>Offset (hexadecimal) <th align=left>Name <th align=left>Length <th align=left>Format <th align=left>Description <tr><td char="." valign="top" >0 <td char="." valign="top" >0 <td char="." valign="top" >SM120XVL <td char="." valign="top" >2 <td char="." valign="top" >binary <td char="." valign="top" >Length of the JobUsage section <tr><td char="." valign="top" >2 <td char="." valign="top" >2 <td char="." valign="top" >SM120XJL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the job identifier field; maximum is 250 <tr><td char="." valign="top" >3 <td char="." valign="top" >3 <td char="." valign="top" >SM120XJ <td char="." valign="top" >250 <td char="." valign="top" >EBCDIC <td char="." valign="top" >Job identifier <tr><td char="." valign="top" ><br> <td char="." valign="top" ><br> <td char="." valign="top" ><br> <td char="." valign="top" ><br> <td char="." valign="top" ><br> <td char="." valign="top" ><br> <tr><td char="." valign="top" >254 <td char="." valign="top" >FE <td char="." valign="top" >SM120XT <td char="." valign="top" >32 <td char="." valign="top" >EBCDIC <td char="." valign="top" > Job submitter <tr><td char="." valign="top" >286 <td char="." valign="top" >11E <td char="." valign="top" >SM120XSL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the job state field; maximum is 32 <tr><td char="." valign="top" >287 <td char="." valign="top" >11F <td char="." valign="top" >SM120XS <td char="." valign="top" >31 <td char="." valign="top" >EBCDIC <td char="." valign="top" >Job state (final). Can be one of: ended, execution failed, or restartable <tr><td char="." valign="top" >319 <td char="." valign="top" >13F <td char="." valign="top" >SM120XNL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the server name field; maximum is 250 <tr><td char="." valign="top" >320 <td char="." valign="top" >140 <td char="." valign="top" >SM120XN <td char="." valign="top" >250 <td char="." valign="top" >EBCDIC <td char="." valign="top" >Server name. <tr><td char="." valign="top" >570 <td char="." valign="top" >23A <td char="." valign="top" >SM120XOL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the node name field; maximum is 250 <tr><td char="." valign="top" >571 <td char="." valign="top" >23B <td char="." valign="top" >SM120XO <td char="." valign="top" >250 <td char="." valign="top" >EBCDIC <td char="." valign="top" > Node name <tr><td char="." valign="top" >821 <td char="." valign="top" >335 <td char="." valign="top" >SM120XAL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the accounting information field; maximum is 64 <tr><td char="." valign="top" >822 <td char="." valign="top" >336 <td char="." valign="top" > SM120XA <td char="." valign="top" >64 <td char="." valign="top" >EBCDIC <td char="." valign="top" >Accounting information. <tr><td char="." valign="top" >886 <td char="." valign="top" >376 <td char="." valign="top" >SM120XBL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the job start time field; maximum is 64 <tr><td char="." valign="top" >887 <td char="." valign="top" >377 <td char="." valign="top" >SM120XB <td char="." valign="top" >64 <td char="." valign="top" >EBCDIC <td char="." valign="top" >Job start time <sup class="ph sup">++</sup> <tr><td char="." valign="top" >951 <td char="." valign="top" >3B7 <td char="." valign="top" >SM120XLL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the last update time field; maximum is 64 <tr><td char="." valign="top" >952 <td char="." valign="top" >3B8 <td char="." valign="top" >SM120XL <td char="." valign="top" >64 <td char="." valign="top" >EBCDIC <td char="." valign="top" >Last update time<sup class="ph sup">++</sup> <tr><td char="." valign="top" >1016 <td char="." valign="top" >3F8 <td char="." valign="top" >SM120XPL <td char="." valign="top" >1 <td char="." valign="top" >binary <td char="." valign="top" >Length of the CPU consumed field; maximum is 64 <tr><td char="." valign="top" >1017 <td char="." valign="top" >3F9 <td char="." valign="top" >SM120XP <td char="." valign="top" >64 <td char="." valign="top" >EBCDIC <td char="." valign="top" >Total CPU consumed in microseconds <tr><td char="." valign="top" >1081 <td char="." valign="top" >439 <td char="." valign="top" >SM120XZ <td char="." valign="top" >64 <td char="." valign="top" >EBCDIC <td char="." valign="top" >CPU time in microseconds on general purpose processors </table> <p> ** The offsets of the fields which follow are based upon a full field. The field contains data that is the maximum field length. The actual offset in the record is the start of the field, plus the length of the field, plus one.</p> <p> <sup class="ph sup">++</sup> Represented as a character string that is the number of milliseconds since January 1 1970, 00:00:00 GMT.</p> <p> Represented as a character string that is the number of units of CPU used, where one unit is 10<sup class="ph sup">-6</sup> seconds. 10<sup class="ph sup">-6</sup> means 10 raised to the -6th power; that is, .000001.</p> <p><br><h3> (ZOS) Job usage with SMF 120 subtype 9 records</h3> <p> Job usage information can be recorded with either SMF 120 subtype 20 records or SMF 120 subtype 9 records. SMF 120 subtype 20 records are described in the section on job usage SMF record layout.</p> <p> SMF 120 subtype 9 records contain many of the metrics included in the SMF 120 subtype 20 records. Additionally, the batch container adds the job ID, the submitter ID, and the job accounting string to the user data section of the SMF 120 subtype 9 record.</p> <p> SMF 120 subtype 9 support for batch jobs requires that SMF 120 subtype 9 recording for <a href="http://setgetweb.com/p/WAS9/ae/was7033.html">asynchronous beans</a> is enabled on the endpoint server. SMF 120 subtype 9 support for <a href="http://setgetweb.com/p/WAS9/ae/was7033.html">asynchronous beans</a> is available on WAS v8.0.0.1 or later. Earlier versions are not supported. If we specify RECORD_SMF_SUBTYPES=9 on an earlier version, the <a href="http://setgetweb.com/p/WAS9/ae/was3381.html">job scheduler</a> issues a message. The message indicates that SMF 120 subtype 9 records are not supported on earlier versions of WAS. The <a href="http://setgetweb.com/p/WAS9/ae/was3381.html">job scheduler</a> reverts to SMF 120 subtype 20 records. <p> If we specify RECORD_SMF_SUBTYPES=9 without also enabling SMF 120 subtype 9 recording for <a href="http://setgetweb.com/p/WAS9/ae/was7033.html">asynchronous beans</a> in the endpoint server, the endpoint server issues a message. The message indicates that SMF 120 subtype 9 recording for <a href="http://setgetweb.com/p/WAS9/ae/was7033.html">asynchronous beans</a> is not enabled. No SMF120 subtype 9 job usage records are collected. <p> The batch container user data type is 101 decimal or x65 hexadecimal. The data has a fixed length of 352 decimal or x160 hexadecimal. All of the fields have fixed lengths. The format of the user data is described in the following table.</p> <p> <p><table cellpadding=5 border=1> <!-- <caption>Table 2. Format of the user data. The table lists the decimal offset, the hexadecimal offset, the length, the format, and the description of the user data.</caption> --> <tr><th align=left>Decimal Offset <th align=left>Hexadecimal offset <th align=left>Length <th align=left>Format <th align=left>Description <tr><td valign=top>0 <td valign=top>0 <td valign=top>1 <td valign=top>Binary <td valign=top>Length of job ID <tr><td valign=top>1 <td valign=top>1 <td valign=top>255 <td valign=top>EBCDIC <td valign=top>Job ID <tr><td valign=top>256 <td valign=top>100 <td valign=top>32 <td valign=top>EBCDIC <td valign=top>Submitter ID <tr><td valign=top>288 <td valign=top>120 <td valign=top>1 <td valign=top>Binary <td valign=top>Length of accounting information <tr><td valign=top>289 <td valign=top>121 <td valign=top>63 <td valign=top>EBCDIC <td valign=top>Accounting information </table> <p><br><h3> (ZOS) Formatting batch SMF records using the SMF Browser</h3> <p> Batch SMF 120 subtype 20 and subtype 9 records can be formatted using the batch add-on to the SMF Browser for WAS for z/OS.</p> <p> Follow the instructions packaged within the add-on and within the SMF Browser utility to invoke the browser.</p> <p> <p> <p><br> <b>Related</b>:<br /> <li><a href="was1031.html"> Multiple servants</a> <li><a href="was510.html"> z/OS workload management and service policies</a> <li><a href="was486.html"> Transaction class propagation on z/OS operating systems</a> <li><a href="was3407.html"> Integrating batch features in z/OS operating systems</a> <li><a href="was3411.html">Manage worker threads</a> <li><a href="was3388.html">Enable job usage information</a> <li><a href="was4695.html">View the output data set</a> <li><a href="was2358.html"> SMF Subtype 9: Request Activity record</a> <p> <br /> <br> <br /><br /> </body> </html>