       >>SOURCE FORMAT FREE
identification division.
program-id. BILLRUN.
*> 교육 영상 시연용 가상 자료 / JJ디지털 / 통신 월 청구 단건 발췌
data division.
linkage section.
01 account-status pic x.
01 member-tier pic x.
01 base-amount pic s9(9) comp-5.
01 billed-amount pic s9(9) comp-5.
01 result-status pic x(8).
procedure division using account-status member-tier
    base-amount billed-amount result-status.
    move 0 to billed-amount
    if base-amount < 0
        move 'ERROR' to result-status
        goback
    end-if
    if account-status not = 'A'
        move 'SKIP' to result-status
        goback
    end-if
    call 'FEEBASE' using member-tier base-amount billed-amount
    move 'READY' to result-status
    call 'PAYPOST' using billed-amount
        on exception move 'MISSING' to result-status
    end-call
    goback.
end program BILLRUN.
