⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ecisync.c

📁 CICS 客户端编程模版
💻 C
字号:
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "cics_eci.h"

#define SERVERNAME   "CICS01"		/* fill in your server name       */
#define	PROGRAMNAME  "SERVER"		/* fill in your program name      */
#define	USERNAME     "CICSUSER"		/* fill in your cics user name    */
#define	PASSWORD     ""				/* fill in your cics user passwd  */

#define ECI_TIMESTAMP_SIZE  18		/* max length of send and receive,<=32000 */

ECI_PARMS	EciParms;

void	main(void);
void	EciSync(int);

void main(void)
{
	int ii;

    printf("ECI Sample Program Started......\n");
    printf("================================\n\n");

    for(ii=0;ii<100;ii++)
		EciSync(ii+1);

	printf("\n================================\n");
    printf("ECI Sample Program ended!!!!!!\n\n");

    exit();
}

void EciSync(ii)
int ii;
{
    short	 Rc;
    char	 CommArea [ECI_TIMESTAMP_SIZE];
    char         pwd[8]="";

    memset (CommArea, '\0', ECI_TIMESTAMP_SIZE);
	memcpy (CommArea, "222222222222222222", ECI_TIMESTAMP_SIZE);
    memset (&EciParms, 0, sizeof (ECI_PARMS));

/*  EciParms.eci_version                           = ECI_VERSION_1A;*/
    EciParms.eci_version                           = ECI_VERSION_1;
    EciParms.eci_call_type                         = ECI_SYNC;
    memcpy(&EciParms.eci_userid,       USERNAME,     8);
    memcpy(&EciParms.eci_password,     pwd,     8);
    memcpy(&EciParms.eci_system_name,  SERVERNAME,   8);
    memcpy(&EciParms.eci_program_name, PROGRAMNAME,  8);
    EciParms.eci_commarea                          = CommArea;
    EciParms.eci_commarea_length                   = ECI_TIMESTAMP_SIZE;
    EciParms.eci_extend_mode                       = ECI_NO_EXTEND;
    EciParms.eci_luw_token                         = ECI_LUW_NEW;
    EciParms.eci_timeout                           = 0;
	memcpy(&EciParms.eci_transid,"CPMI",4);
	/*memcpy(&EciParms.eci_tpn,"CPMI",4);*/
/*锌版本*/

    Rc = CICS_ExternalCall (&EciParms);
    
    if (Rc == ECI_NO_ERROR)
		printf ("[%06d]CommArea Returned: %s\n",ii,CommArea);
    else
		printf ("[%06d]Rc=%d and Abend Code=##%4.4s##\n",ii,Rc,EciParms.eci_abend_code);
    return;
}

⌨️ 快捷键说明

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