📄 pcs_rd_bk_q_yx.pc
字号:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
* File name : Pcs_Rd_BK_Q.x *
* Module ID : *
* Module Name : *
* Purpose : save data from MQ to YX *
* Author : lix *
* Date Created : 1999,08,09 *
* Version : Version 1.0 *
* Environment : Digital UNIX *
* Portability : UNIX Platform *
* Warnings : *
* References : *
* Calling Syntax : *
* Parameters : None *
* Returns : void *
* Calling Function : the main function of pcs_rd_bk_q *
* Called Functions : *
* Datastores and usages: *
* (a) Input *
* (b) OutPut *
* Report : None *
* Screens : None *
* Messages Files : None *
* Change Log : *
* Change No. Date Author Reason For Change *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
#include "stdio.h"
#include "stdlib.h"
#include "sqlcpr.h"
#include <fcntl.h>
#include <signal.h>
#include "/usr/bkfx/include/myapi.h"
#include "/usr/bkfx/include/Pcs_RD_BK_Q_x/Pcs_RD_BK_Q_YX.h"
#include "/usr/bkfx/include/Pcs_RD_BK_Q_x/yxapi.h"
void main( )
{
int ret_code=0,iTInterval;
long int buf_length;
char *PID = "Client Txn Clt_Mpt Process(Port 7111)";
char data_type[32];
char produce_err_str[20];
ERROR=0;
signal(SIGTERM,freect);
ProcessError(LOG_NORMAL,"PCS_RCV_YX: this is NORMAL message",END);
iTInterval=GetTimeInterval("PCS_RCV_YX");
ret_code=InitPcsRcvYX();
if( ret_code !=0 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YX: connect database error",END);
exit(0);
}
begin:
NOT_CONNECT=0;
ret_code = MQBKInit("YX");
if ( ret_code < 0 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YX: Calling Funtion MQBKInit(YX) Failed!",END);
goto End;
}
buf=(char *) malloc ( MAX*sizeof(char));
if( buf==NULL )
{
ProcessError(LOG_ERROR,"PCS_RCV_YX: there is no space in memory",END);
sleep(iTInterval);
goto End;
}
for( ; ; )
{
buf[0]='\0';
ret_code = MQBKReceiveSyn_Wait( &buf_length, buf, data_type );
if ( ret_code < 0 )
{
break;
}
#ifdef DEBUG
PutintoF(buf);
#endif
if ( buf_length!=strlen(buf) )
{
ProcessError(LOG_ERROR,\
"PCS_RCV_YX: received buf length is not right",END);
break;
}
ret_code = PcsRcvYX( buf, buf_length);
if ( ret_code < 0 )
{
myapi_ReadString(buf,produce_err_str,0,13);
ProcessError(LOG_ERROR,"PCS_RCV_YX: Calling Funtion PCSRcvYS() Failed! part msg is:",produce_err_str);
EXEC SQL ROLLBACK WORK;
if( NOT_CONNECT ==1 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YX: database may be shutdown now!",END);
goto End;
}
continue;
}
EXEC SQL COMMIT WORK ;
}
free(buf);
End:
ret_code=MQBKClear();
if( ret_code < 0 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: error when clear tuxedo",END);
}
#ifdef DEBUG
exit(0);
#endif
sleep(iTInterval);
goto begin;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -