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;

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

/\ Call the QWDRJOBD API.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

QWDRJOBD(rec_var,

/\ Receiver

Variable

\/

rec_len,

/\ Receiver

Length

\/

"JOBDð1ðð",

/\ Format Name

\/

qual_job_desc,

/\

Qualified Job Description

\/

&error_code);

/\

Error Code

\/

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

/\ If an error was returned, send an error message.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ if(error_code.ec_fields.Bytes_Available > ð)

{

/\ In this example, nothing was done for the error condition￿.

\/

}

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

/\ Let's tell everyone what the library value was for this jo￿b. \/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ else

{

num_libs = ((JOBDð1ðð \)rec_var)->data.Number_Libs_In_Lib_list; offset = ((JOBDð1ðð \)rec_var)->data.Offset_Initial_Lib_List;

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

/\

Advance

receiver variable pointer to the location where￿ the

\/

/\

library

list begins.

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ rec_ptr += offset;

for(i=ð; i<num_libs; i++)

{

memcpy(library, rec_ptr, 1ð); sprintf(command_string,

"SNDMSG MSG('LIBRARY %.1ðs') TOUSR(QPGMR)", library);

system(command_string);

B-24System API Programming V4R1

Page 302
Image 302
IBM Version 4 manual 24System API Programming V4R1