#include #include #include #include #include #include #include /* triml */ #include #include #define TRUE 0 #define FALSE -1 typedef struct { int BYTESPRO; int BYTESAVL; char MSGID[7]; char RESRVD; char EXCPDATA[100]; } ERRSTRUCTURE; /* Define the error return structure */ ERRSTRUCTURE errcode;/* API Error Code Structure */ typedef struct { char NM[10]; char LIB[10]; } QNAME; /* Define the qualified name */ QNAME inname; /* Qualified user space name */ typedef struct { char JOB[10]; char USER[10]; char JOBNBR[6]; } JOBINFO; JOBINFO jobinfo; int offset, size, entries; typedef _Packed struct header_struct { char user_data[64]; int generic_header_size; char header_version[4]; char format_name[8]; char program_name[10]; char time_generated[13]; char information_status; int usrspc_used; int parm_section_offset; int parm_section_size; int header_section_offset; int header_section_size; int list_section_offset; int list_section_size; int number_of_entries; int size_of_entry; } header_struct; header_struct inspace; char ref[132]; /*************************************************************/ /* 内 部 使 用  関  数 */ /*************************************************************/ void CreateUsrSpace(char* space, char* lib); void ApiError(char* place); void SendMessage(char* Message, char* Status, char* Pgmque); void main(void){ int i; char Job[11], User[11], Nbr[7]; Qus_JOBL0100_t jobl0100; printf("** TESTUSLJOB : QUSLJOB のテスト **\n"); getchar(); /*(1) QUSCRTUS: ユーザー・スペースの作成 */ CreateUsrSpace("USLJOB ", "QTEMP "); /*(2) QUSLJOB: ユーザー QTMHHTTP のジョブ一覧を出力する */ memcpy(jobinfo.JOB, "*ALL ", 10); memcpy(jobinfo.USER, "QTMHHTTP ", 10); memcpy(jobinfo.JOBNBR, "*ALL ", 6); QUSLJOB((char*)&inname, "JOBL0100", (char*)&jobinfo, "*ACTIVE ", &errcode); if(errcode.BYTESAVL != 0){/*APIERR*/ ApiError("MAIN-QUSLJOB"); exit(0); }/*APIERR*/ /*(3) QUSRTVUS: ユーザー・スペースを読んで初期情報を取得する */ QUSRTVUS("USLJOB QTEMP ", 0x01,sizeof(inspace), &inspace, (char*)&errcode); if(errcode.BYTESAVL != 0){/*APIERR*/ sprintf(ref, "QUSRTVUS-%d", __LINE__); ApiError(ref); return; }/*APIERR*/ offset = inspace.list_section_offset +1; size = inspace.size_of_entry; entries = inspace.number_of_entries; /*(4) QUSRTVUS: ユーザー・スペースを LOOP して読み取る */ for(i = 0; i