sp040801.cpre

来自「商业银行前置系统」· CPRE 代码 · 共 94 行

CPRE
94
字号
/* * This is a part of the Applictiaon Preconsole * - Service Provide - MSI. * Copyright (C) 2000-2000 ABC.SDC. * All rights reserved. * * This source code is only intended as a supplement to the * Applictiaon Preconsole Reference and related * electronic documenttiaon provided with the library. * See these sources for detailed informtiaon regarding the * Applictiaon Preconsole product.  * * Update record: * 2001-11-17 whl     - create implementtiaon file for cics *                      program of msi service - 查询交费金额 */#include <sybtesql.h>#include "ap.h"#include "apsc.h"#include "msi.h"EXEC SQL INCLUDE sqlca;/* * Main function */void main(){    TIASTRU tiastru;    TOASTRU toastru;    char szBal[AP_LEN_BAL + 1];        char cCommArea[3000];    unsigned long lRespCode;        PXMLSTRU pxmlstruResp;    PXMLSTRU pxmlstruReq;        memset(&tiastru, 0, sizeof(tiastru));    if (!VERIFY_NULL(pxmlstruResp = ApScGetRespXml()) ||        !VERIFY_NULL(pxmlstruReq = ApScGetReqXml()))        EXEC CICS RETURN;    AP_DEMAND(AP_PATH_COLLECTMON, tiastru.szMonth);    if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_PHONENO, tiastru.szPhoneNo)))    {        ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR);        EXEC CICS RETURN;    }    tiastru.nTransCode = 801;            bufclr(cCommArea);    tprintf(cCommArea, FMT_TIA, VAR_TIA);        PrintLog(stderr, "Linking MSI...");    EXEC CICS ADDRESS EIB(dfheiptr);    EXEC CICS LINK PROGRAM("S053") COMMAREA(cCommArea)              LENGTH(sizeof(cCommArea)) SYNCONRETURN RESP(lRespCode);    if (!VERIFY(lRespCode == DFHRESP(NORMAL)))    {        ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_SYSERR);        EXEC CICS RETURN;    }    tscanf(cCommArea, FMT_TOA, VAR_TOA);    if (toastru.cRespType != 'N')    {        ApUpdateRespCode(pxmlstruResp, toastru.szErrCode);        EXEC CICS RETURN;    }    sprintf(szBal, "%19.2lf", toastru.dBal);    if (!VERIFY_NORMAL(AP_INSERT(AP_PATH_PHONECOST, szBal)))    {        ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_SYSERR);        EXEC CICS RETURN;    }        ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_ACCEPT);    EXEC CICS RETURN;}/* End of this file */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?