Your procedures for operating the application server might include the use of DB2 Server for VSE accounting. You enable accounting by specifying ACCOUNT=T,E, or D upon initialization. The default, ACCOUNT=N, indicates that accounting is not done. (ACCOUNT is an initialization parameter.)
If ACCOUNT=T, the application server writes accounting records to a tape file identified in the job control for startup. If ACCOUNT=D, the application server writes accounting records to a DASD file, which you must identify in the job control. If ACCOUNT=E, the application server writes accounting records to a VSAM ESDS file, which you must identify in the job control.
If you start the application server and direct accounting output to a tape file, you are requested to mount a tape and you are prompted for the cuu of the tape drive. (When accounting information is directed to a DASD file, no prompt is necessary.)
When accounting to tape, the application server avoids overlaying the previous session's accounting information by not rewinding the accounting tape at OPEN or CLOSE time. The next time you startup, another file is written starting after the previous session's file. When you direct accounting information to DASD, the problem of overlaying a previous session's file exists only if stand-alone sequential access method (SAM) manages the file. If stand-alone SAM manages the DASD file, you should refer to the DB2 Server for VSE System Administration manual for information about setting up job control and operating procedures that avoid the problem.
When the application server ends either normally or abnormally, it attempts to close the accounting file. If the accounting file is on tape and, for some reason, the accounting file cannot be closed, you should manually write a tape mark. Use the VSE MTC WTM command to write a tape mark. The VSE/ESA System Control Statements manual describes the MTC WTM command.
Your procedures for accounting might also include the use of DB2 Server for VSE alternate accounting file support. The alternate accounting file support lets you switch to an alternate accounting file in two ways: by using the DB2 Server for VSE ALTACCT operator command, or by requesting the use of an alternate file in response to an error message.
The job control for starting the application server must include job control for two accounting files for the application server to use the alternate accounting file support. Both files must be either on tape or on DASD. (You cannot have one file defined on tape and the other on DASD.) The file name on the TLBL or DLBL statement for the first accounting file is ARIACC1. The file name on the TLBL or DLBL statement for the second accounting file is ARIACC2.
The job control for the accounting files should already be in the job control procedure that identifies the application server. If the job control has not been included, see "Setting Up Job Control for the Accounting Files" in the DB2 Server for VSE System Administration manual.
You must switch to the alternate accounting file when:
In the first two cases, you do not need to enter the ALTACCT command. When the application server detects the error, it issues a message asking whether you want to:
Aside from the error conditions, the other reason you would want to switch accounting files is to close the current file without stopping the application server. Then one accounting file can be processed while operation continues. In this situation, enter the ALTACCT command. Note that ALTACCT has no parameters.
>>-ALTACCT----------------------------------------------------->< |
When you start the application server to use accounting, the ARIACC1 file is always opened first. When you request that the application server use the alternate file, it closes the ARIACC1 file and opens the alternate file (ARIACC2).
If you direct the accounting output to tape, the application server prompts you for the cuu of the alternate file. The cuu of the first accounting file is unassigned. Thus, until you restart, the cuu of the first accounting file is available for any purpose, including reuse for an alternate accounting file.
If you enter ALTACCT again, the application server closes ARIACC2 and opens ARIACC1. You can switch between accounting files any number of times during a session.