/*
 * RC_STATS.pgc - rc 모듈 서비스 RC_STATS (one service = one file).
 * Moved verbatim from the former inline rc_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by rc_svr at tpsvrinit.
 */
#include "RC_STATS.h"

/* 20. RC_STATS - MATCHED/EXCEPTION 통계 (dbio count). */
void RC_STATS(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char bizdate[16];
    long matched, exc;
    gets_(b, T_BIZDATE, bizdate, sizeof(bizdate));
    matched = rcdb_count_match(bizdate, "MATCHED");
    exc = rcdb_count_match(bizdate, "EXCEPTION");
    if (matched < 0 || exc < 0) FAIL(b);
    setl(b, T_COUNT, matched);
    setl(b, T_RC, exc);
    OK(b);
}

/* vim: set ts=4 sw=4 et smartindent: */
