} 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[25];

char

message_string[29];

FILE

\stream;

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,

\/

/\ so we need to evaluate argc-1.

\/

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

if (((argc - 1) < 2) ((argc - 1 > 2))) /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\

We did not receive all of the required parameters so exit￿ the

\/

/\

program.

\/

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

{

exit(1);

}

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

/\ Move the two parameter passed into qual_job_desc.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ memcpy(qual_job_ptr, argv[1], 1ð);

qual_job_ptr += 1ð;

memcpy(qual_job_ptr, argv[2], 1ð);

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

/\ Set the error code parameter to 16.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ error_code.ec_fields.Bytes_Provided = 16;

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ /\ Open QPRINT file so that data can be written to it. If the file \/

/\ cannot be opened, print a message and exit.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ if((stream = fopen("QPRINT", "wb")) == NULL)

{

printf("File could not be opened\n"); exit(1);

}

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

/\ Call the QWDRJOBD API.

 

\/

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

QWDRJOBD(rec_var,

/\ Receiver Variable

\/

 

Appendix B. Original Examples in

Additional BLanguages-17

Page 295
Image 295
IBM Version 4 manual File