📄 sp010802.cpre
字号:
/* * This is a part of the Application Preconsole * - Service Provide - ABIS. * Copyright (C) 2000-2000 ABC.SDC. * All rights reserved. * * This source code is only intended as a supplement to the * Application Preconsole Reference and related * electronic documentation provided with the library. * See these sources for detailed information regarding the * Application Preconsole product. * * Update record: * 2001-11-17 whl - create implementation file for cics * program of mediate service - 电话交费 */#include <sybtesql.h>#include "ap.h"#include "apsc.h"#include "abisemu.h"EXEC SQL INCLUDE sqlca;/* * Main function */void main(){ TIASTRU tiastru; TOASTRU toastru; char szBal[AP_LEN_BAL + 1]; char szAmt[AP_LEN_AMT + 1]; char szMsgType[AP_LEN_MSGTYPE + 1]; char cCommArea[3000]; unsigned long lRespCode; PXMLSTRU pxmlstruResp; PXMLSTRU pxmlstruReq; memset(&tiastru, 0, sizeof(tiastru)); memset(&toastru, 0, sizeof(toastru)); if (!VERIFY_NULL(pxmlstruResp = ApScGetRespXml()) || !VERIFY_NULL(pxmlstruReq = ApScGetReqXml())) EXEC CICS RETURN; AP_DEMAND_EXT(AP_PATH_SEQNO, tiastru.szSeqNo); AP_DEMAND(AP_PATH_MSGTYPE, szMsgType); AP_DEMAND(AP_PATH_ACCPWD, tiastru.szAccPwd); AP_DEMAND(AP_PATH_REQDATE, tiastru.szDate); AP_DEMAND(AP_PATH_AMT, szAmt); tiastru.dAmt = atof(szAmt); if (strcmp(szMsgType, AP_MSGTYPE_CANCELREQ) == 0) tiastru.sCancelFlag = 1; else if (strcmp(szMsgType, AP_MSGTYPE_SUBMITREQ) == 0) tiastru.sCancelFlag = 0; else { VERIFY(FALSE); ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_ACCNO, tiastru.szAccNo))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } tiastru.nTransCode = 802; bufclr(cCommArea); tprintf(cCommArea, FMT_TIA, VAR_TIA); PrintLog(stderr, "Linking ABIS..."); EXEC CICS ADDRESS EIB(dfheiptr); EXEC CICS LINK PROGRAM("S051") COMMAREA(cCommArea) LENGTH(sizeof(cCommArea)) SYNCONRETURN RESP(lRespCode); if (!VERIFY(lRespCode != DFHRESP(ROLLEDBACK))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_EXCEPTION); EXEC CICS RETURN; } 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_BAL, szBal))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_EXCEPTION); EXEC CICS RETURN; } ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_ACCEPT); EXEC CICS RETURN;}/* End of this file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -