📄 pcs_rd_bk_q_ys.pc
字号:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* File name : PCS_RD_BK_Q.x *
* Module ID : *
* Module Name : *
* Purpose : Get GH Data from GHFile And Insert into DB *
* Author : Li xun (DIMPT) *
* Date Created : 1999,07,27 *
* Version : Version 1.0 *
* Environment : Digital UNIX *
* Portability : UNIX Platform *
* Warnings : *
* References : *
* Calling Syntax : *
* Parameters : None *
* Returns : void *
* Calling Function: *
* Called Functions: When system startup *
* 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 <sqlca.h>
#include <time.h>
#include <stddef.h>
#include <fcntl.h>
#include <signal.h>
#include "sqlcpr.h"
#include "/usr/bkfx/include/myapi.h"
#include "/usr/bkfx/include/Pcs_RD_BK_Q_x/Pcs_RD_BK_Q_YS.h"
#include "/usr/bkfx/include/Pcs_RD_BK_Q_x/ysapi.h"
void main( )
{
int ret_code,iTInterval,flag;
char *PID = "Client Txn Clt_Mpt Process(Port 7111)";
char data_type[32];
char produce_err_str[25];
ERROR=0;
ProcessError(LOG_NORMAL,"PCS_RCV_YS: this is NORMAL message",END);
signal( SIGTERM,freect );
flag=InitPcsRcvYS();
if( flag!=0 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: error when init function ", "PcsRcvYS");
exit(0);
}
iTInterval=GetTimeInterval("PCS_RCV_YS");
begin:
NOT_CONNECT=0;
ret_code = MQBKInit("YS");
if ( ret_code < 0 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: Calling Funtion MQBKInit() Failed!",END);
goto End;
}
buf=(char *) malloc ( MAX_YSLEN*sizeof(char));
if( buf==NULL )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: there is no space in memory",END);
goto End;
}
for(;;)
{
ret_code = MQBKReceiveSyn_Wait( &buf_length, buf, "YS");
if ( ret_code < 0 )
{
break;
}
#ifdef DEBUG
PutintoF(buf);
#endif
if ( buf_length!=strlen(buf) )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: receive buf length is not right",END);
break;
}
myapi_ReadString(buf,produce_err_str,0,21);
/* ret_code=checkerr_sndgh(produce_err_str,buf[20]);
if( ret_code < 0 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: Calling Function check error,part msg is :",produce_err_str);
EXEC SQL ROLLBACK WORK;
continue;
}
*/
ret_code = PcsRcvYS( buf, buf_length );
if ( ret_code < 0 )
{
myapi_ReadString(buf,produce_err_str,0,21);
ret_code=checkerr_sndgh(produce_err_str,buf[20]);
if( ret_code < 0 )
ProcessError(LOG_ERROR,"PCS_RCV_YS: Calling Funtion PCSRcvYS() Failed!part msg is:",produce_err_str);
EXEC SQL ROLLBACK WORK;
if( NOT_CONNECT==1 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: database may be shutdown now!",END);
goto End;
}
continue;
}
EXEC SQL COMMIT WORK;
}
free(buf);
End:
putitto_netwk();
ret_code=MQBKClear();
if( ret_code < 0 )
{
ProcessError(LOG_ERROR,"PCS_RCV_YS: error when clear tuxedo",END);
}
#ifdef DEBUG
printf("here exit normal\n");
exit(0);
#endif
sleep(iTInterval);
goto begin;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -