Processing accounting files

Transfer CFT maintains accounting data on successful transfers in two accounting files. The primary and alternate files are managed in turn and are pointed to by the CFTACNT and CFTACNTA environment variables, respectively.

This topic provides an example of the accounting file, and how to test that the accounting configuration is correct.

The general principles of accounting files are described in Defining the recording mode.

Unlike log files, the ASCII contents of which can be viewed directly using an editor or other standard tool, accounting files are binary-coded. A specific tool is required to process this information depending, on the criteria applying in each work situation.

The programming example provided below should clarify this aspect. The program operates in a similar way to the catalog display commands, in that it scans an accounting file and displays all the fields stored for each record.

Note The data stored in the accounting files is likely to change over time in terms of volume or value. You are therefore advised to recompile any program that you may develop from the information provided in these files each time Transfer CFT is updated.

Although this example is part of the standard package, it is only loaded on to your system if you request the Programming interface and EXITs installation option.

Sample file components

The <installdir>/runtime/src/exit subdirectory contains:

  • A sample source module, called exacct.c, with its associated include file (exacct.h)
  • The mk_exacct compilation procedure, which uses the exacct.c sample source module to generate the EXACCT executable file; this file is automatically stored in the <installdir>/bin/ subdirectory

To generate the EXACCT sample file, proceed as follows:

  1. Access the <installdir>/runtime/src/exit/ directory.
  2. Enter the command:

     make -f mk_exacct

The sample file provided uses the Full ANSI C syntax. If your C compiler does not use this mode by default, set the appropriate option.

On some systems (HPUX for example), a compilation error may arise because the
uchar_t
type is undefined. If this occurs, rerun the make command with the
additional parameter CFLAGS=-DACCT_UCHAR, in other words:

make -f mk_exacct CFLAGS=-DACCT_UCHAR

Testing the accounting file configuration

This test can only be run if you have already made successful transfers with Transfer CFT from one of the test configurations provided (cft-tcp.conf or cft-coms.conf).

Proceed as follows:

  1. Access the <installdir>/runtime/log/ directory.
  2. Using the ls -l command applied to this directory, select the file to be tested from the two accounting files (by default the cft_acnt file or the cft_acnta alternate file). The alternate file is used in the example.
  3. Run the EXACCT program with the name of the accounting file as a parameter:

    EXACCT cft_acnta

  4. Check that the various fields of your transfers are displayed.

Related Links