[324,202] REPORT - IAS V3.0 - Generate Monthly Accounting Report SUBMITTED BY: John Hayes Allen-Bradley NC Systems Division 747 Alpha Drive Cleveland, Ohio 44143 (216) 449-6700 I. DESCRIPTION The files contained in this directory pertain to the generation of monthly reports based on CPU usage, connect time, and amount of disk storage allocated. These values are calculated on a per user basis and tabulated per group code (GIC) and per user defined departments. The monthly report program gets pertainent data about users from the user profile file SY0:[1,100]PDSUPF.DAT. Any user defined in this file will be included in the report's output. In order to implement the monthly accounting report, a patch must be made to PDS to prevent the clearing of the users logged in count. This change to PDS is made by issuing a GBLPAT directive in the PDSTKB.CMD file. The output of REPORT is sent to Fortran logical unit 2 using Fortran carriage control. The logical unit can be assigned to another device, such as a line printer, at run time or can be included in the task build option list. II. BUILDING THE MONTHLY REPORT TASK The whole REPORT task source is contained in the Fortran IV+ source module REPORT.FTN. REPORT.FTN is made up of a main routine and 5 subroutines. The command file REPORT.BLD can be invoked to compile and build the routine. Before running REPORT, you must make a minor modification to the PDS command language interpreter. This is accomplished by including a GBLPAT in the PDSTKB.CMD file (found on the IAS V3.0 release tape in directory [11,100]). The details of this patch may be found in the file PDSTKB.ADD in this directory. Note that a second patch to PDSTKB.CMD is also included in this file. The second patch changes the logout message from "BYE" to an escape sequence which will force a reset to occur on a VT100 terminal, or a clear screen to occur on a VT52. This patch is optional and has nothing to do with the REPORT task. III. GENERATING THE MONTHLY (WEEKLY, OR DAILY) REPORT Once REPORT has been built and PDS has been modified and installed, you must come up with a configuration file to decide which GIC's belong in which departments. The current version of REPORT expects to find this file, CONFIG.DAT, on device LB0: in directory [1,100]. The code can be modified, but the current version suits our installation just fine. CONFIG.DAT contains two types of configuration data, group identifiers and department identifiers. The format of the department identifier is a 3 digit octal string whose value is zero, a two digit decimal department number, and a 40 character department name. The format of the group identifer record is a 3 digit octal value representing the GIC, a two digit decimal value representing which department the GIC belongs to, and a 40 character group name. These two types of records can occur in any order in the CONFIG.DAT file. The current version of REPORT can only handle 300 users, 32 groups, and 8 departments, due to task size constraints. Note that if a GIC found in PDSUPF.DAT is not in the configuration file, that GIC's usage is totaled as if it belonged to the maximum department number (in this case, department 8). The following example of CONFIG.DAT should fully confuse the whole matter: 00001COMPUTER CENTER 00002ENGINEERING TRAINING PROGRAM 00008MISCELANEOUS ACCOUNTS 00101SYSTEM MANAGEMENT 00201SYSTEM DEVELOPMENT 10002FIRST YEAR TRAINEES 10102SECOND YEAR TRAINEES The above file would define three departments, the computer center, an engineering training program, and a catch all department. As you may remember, any group not defined in CONFIG.DAT but contained in the user profile file will automatically be categorized as the maximum department number (in our case department 8). The remaining portion of the configuration file deals with defining which groups of GIC's belong to which department. All users which default to [1,*] on any device are categorized under the SYSTEM MANAGEMENT group under the COMPUTER CENTER department. All users in [2,*] are in the SYSTEM DEVELOPMENT group, also under the reins of the COMPUTER CENTER department. Users with defaults of [100,*] and [101,*] fall under the auspices of the ENGINEERING TRAINING PROGRAM department. Any group other than [1,*], [2,*], [100,*], or [101,*] will be grouped with their individual GIC's with no group heading, and will be included in department 8, which we have cleverly described as MISCELANEOUS ACCOUNTS. Please note that the order of the configuration file is not important. The lines in the above example can be put in any order your heart desires. The only thing to consider is that if you define a group more than once, the definition nearest the bottom of the CONFIG.DAT file will be used. IV. NOTES ABOUT RUNNING REPORT Due to the fact that REPORT spawns PIP for each user encountered to do a summary to determine disk storage allocated, this program can take a while to run (our system with 129 user accounts takes roughly 30 minutes to run in the BATCH stream). If you want to run a report with only CPU utilization and connect time figures, the DISK subroutine can be modified to simply set variable ALLOC equal to 0 and return with no further action. This modification to subroutine DISK reduces execution time of REPORT from roughly 30 minutes to under 30 seconds. Throughout this description I have refered to this program as one which generates a monthly report. The truth of the matter is that this program does not actually have to be run on a monthly basis, nor does the execution of REPORT do anything to modify the user profile file PDSUPF.DAT. The report generated by this program is simply a more readable version of the data provided by a "USERS EXAM/PRINT ALL". At our installation, we run the long version (with disk allocation summary) on the last working day of the month, then zero the statistics in the profile file by invoking a "USERS ZERO ALL". During the month, we occasionally check to see how the system utilization for the month is going by running the fast version of REPORT (with the dummy DISK subroutine described in the previous paragraph). In this second case, we do not zero the accounting data. So this program could be used in generating daily, weekly, quarterly, or even yearly(shudder) reports depending on when you zero the accounting data in PDSUPF.DAT. As always, should you or any of your Mission Ridiculous team have any questions or comments, I will disavow any knowledge of the above program. Seriously, call me or write to me about any problems related to REPORT that you might encounter.