Retrieving the Hold Parameter (Error Code Structure)—ILE C Example

Refer to “Retrieving the Hold Parameter (Error Code Structure)—OPM RPG Example” on page 3-11 for the original example.

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

 

\/

/\Program Name:

JOBDAPI

\/

/\

 

\/

/\Programming Language:

ILE C

\/

/\

 

\/

/\Description:

This example shows how to make use of an

\/

/\

error returned in the error code structure.

\/

/\

 

\/

/\Header Files Included: STDIO - Standard Input/Output

\/

/\

STRING - String Functions

\/

/\

QUSEC - Error Code Parameter

\/

/\

QWDRJOBD - Retrieve Job Description API

\/

/\

QLIEPT - Entry Point Table

\/

/\

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

#include <stdio.h>

 

 

 

 

 

#include <string.h>

 

 

 

 

 

#include <qusec.h> .14/

/\

Error Code Parameter Include

for the

API

\/

#include

<qwdrjobd.h>

/\

Retrieve Job Description API

Include

 

\/

#include

<qliept.h>

 

 

 

 

 

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Error Code Structure

\/

/\

\/

/\ This shows how the user can define the variable length po￿rtion of

\/

/\ error code for the exception data.

\/

/\

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

typedef struct {

 

Qus_EC_t

ec_fields;

char

Exception_Data[1ðð];

} error_code_t;

main(int argc, char \argv[])

{

error_code_t error_code;

char

qual_job_desc[2ð];

char

\qual_job_ptr = qual_job_desc;

char

rec_var[39ð];

char

hold_value[1ð];

char

message_id[7];

char

command_string[53];

char

message_string[67];

memset(hold_value, ' ', 1ð); /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Make sure

we received the correct

number of parameters. T￿he argc

\/

/\

parameter

will contain the number

of parameters that was￿ passed

\/

/\

to this program. This number also

includes the program it￿self,

\/

B-10System API Programming V4R1

Page 288
Image 288
IBM Version 4 manual Jobdapi