Job usage data for charge-back accounting support

The product provides charge-back accounting information for batch jobs for all operating systems. You can use charge-back accounting to determine the computing costs of batch job execution for work that has been performed by various users and groups.

The job scheduler 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.

Accounting information for each job includes:
  • Job identity: The job identifier associated with the job, which is returned by the job scheduler when the job is submitted
  • Submitter identity: The identity (if any) of the submitter of the job
  • CPU used:
    • [AIX Solaris HP-UX Linux Windows]An integer that is the number of units of CPU used, where one unit is 10-6 seconds.
    • [z/OS]A value in nanoseconds, which is 64 bits. To obtain a value in milliseconds, divide the nanoseconds value by 1000, and then divide that value by 1000. For example, if the value that is retrieved from the table is 433064553000, then the following formula converts this value into milliseconds:
      433064553000 / (1000*1000) = 433064.55 milliseconds
  • Job state: The state of the job. That is, running or ended.
  • Node name and server name: The node and server names where the job ran
  • Job start time: The time the job began to run
  • Last update time: The time of the last job usage update
  • Accounting string: The job accounting information associated with the job
The DDL statements for the job scheduler JOBUSAGE table are defined in the CreateLRSCHEDTables*.ddl files of the app_server_root/util/Batch directory. An example schema definition is:
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" ;
The table data can be accessed with an SQL query, for example:
select * from LRSSCHEMA.JOBUSAGE where JOBID='PostingSampleEar:99'

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.

[z/OS]

Job usage SMF record layout

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:

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.
Offset (decimal) Offset (hexadecimal) Name Length Format Description
0 0 SM120XVL 2 binary Length of the JobUsage section
2 2 SM120XJL 1 binary Length of the job identifier field; maximum is 250
3 3 SM120XJ 250 EBCDIC Job identifier
           
254 FE SM120XT 32 EBCDIC Job submitter
286 11E SM120XSL 1 binary Length of the job state field; maximum is 32
287 11F SM120XS 31 EBCDIC Job state (final). Can be one of: ended, execution failed, or restartable
319 13F SM120XNL 1 binary Length of the server name field; maximum is 250
320 140 SM120XN 250 EBCDIC Server name.
570 23A SM120XOL 1 binary Length of the node name field; maximum is 250
571 23B SM120XO 250 EBCDIC Node name
821 335 SM120XAL 1 binary Length of the accounting information field; maximum is 64
822 336 SM120XA 64 EBCDIC Accounting information.
886 376 SM120XBL 1 binary Length of the job start time field; maximum is 64
887 377 SM120XB 64 EBCDIC Job start time ++
951 3B7 SM120XLL 1 binary Length of the last update time field; maximum is 64
952 3B8 SM120XL 64 EBCDIC Last update time++
1016 3F8 SM120XPL 1 binary Length of the CPU consumed field; maximum is 64
1017 3F9 SM120XP 64 EBCDIC Total CPU consumed in microseconds ^ ^
1081 439 SM120XZ 64 EBCDIC CPU time in microseconds on general purpose processors ^ ^

** 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.

++ Represented as a character string that is the number of milliseconds since January 1 1970, 00:00:00 GMT.

^ ^ Represented as a character string that is the number of units of CPU used, where one unit is 10-6 seconds. 10-6 means 10 raised to the -6th power; that is, .000001.

[z/OS]

Job usage with SMF 120 subtype 9 records

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.

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.

Avoid trouble: SMF 120 subtype 9 support for batch jobs requires that SMF 120 subtype 9 recording for asynchronous beans is enabled on the endpoint server. SMF 120 subtype 9 support for asynchronous beans is available on WebSphere Application Server Version 8.0.0.1 or later. Earlier versions are not supported. If you specify RECORD_SMF_SUBTYPES=9 on an earlier version, the job scheduler issues a message. The message indicates that SMF 120 subtype 9 records are not supported on earlier versions of WebSphere Application Server. The job scheduler reverts to SMF 120 subtype 20 records.
Avoid trouble: If you specify RECORD_SMF_SUBTYPES=9 without also enabling SMF 120 subtype 9 recording for asynchronous beans in the endpoint server, the endpoint server issues a message. The message indicates that SMF 120 subtype 9 recording for asynchronous beans is not enabled. No SMF120 subtype 9 job usage records are collected.

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.

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.
Decimal Offset Hexadecimal offset Length Format Description
0 0 1 Binary Length of job ID
1 1 255 EBCDIC Job ID
256 100 32 EBCDIC Submitter ID
288 120 1 Binary Length of accounting information
289 121 63 EBCDIC Accounting information
[z/OS]

Formatting batch SMF records using the SMF Browser

Batch SMF 120 subtype 20 and subtype 9 records can be formatted using the batch add-on to the SMF Browser for WebSphere Application Server for z/OS.

Follow the instructions packaged within the add-on and within the SMF Browser utility to invoke the browser.