SAFROUTE API を使用して独自の監査イベントを作成できます。この API は、Enterprise Server アプリケーションのセキュリティ関連の要求を処理します。AUDIT 要求タイプを使用して、Enterprise Server でホストされている COBOL プログラム内に独自の監査エントリ ポイントを作成します。
SAFROUTE API は、製品のインストール ディレクトリの cpylib ディレクトリ内のコピーブックで定義されています。デフォルトは %ProgramFiles(x86)%\Micro Focus\Visual COBOL\cpylib\SAFAPI.CPY (Windows) または /opt/microfocus/VisualCOBOL/cpylib/SAFAPI.cpy (UNIX) です。
監査イベントは ENTITY 項目と LOGSTR 項目で構成され、任意の文字列を含めることができます。提供されている場合は、ACEE に関連付けられたユーザー名を使用することもできます。監査イベントは、監査イベント コード 5:1 と 5:2 にそれぞれマップされた「成功」または「失敗」のいずれかとして扱うことができます。
identification division. program-id. testprog. environment division. configuration section. data division. working-storage section. copy "SAFAPI.cpy" replacing ==()== by ==ws==. 01 ws-audit-entity pic x(11) value "AuditEntity". 01 ws-audit-string pic x(11) value "AuditString". procedure division. move low-values to ws-safpb-parameter-block set ws-safpb-cur-ver-88 to true set ws-safpb-audit-req-88 to true set ws-safpb-audit-success-88 to true set ws-safpb-codeset-utf8-88 to true set ws-safpb-mod-CICS-88 to true set ws-safpb-audit-ENTITY-ptr to address of ws-audit-entity set ws-safpb-audit-ENTITY-len to length of ws-audit-entity set ws-safpb-audit-LOGSTR-ptr to address of ws-audit-string set ws-safpb-audit-LOGSTR-len to length of ws-audit-string call 'SAFROUTE' using ws-safpb-parameter-block if ws-safpb-api-rc > 0 *> Audit call failed end-if goback. end program testprog.