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

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 parameters passed into qual_job_desc. .9/\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ memcpy(qual_job_ptr, argv[1], 1ð);

qual_job_ptr += 1ð;

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

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

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

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

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

QWDRJOBD(rec_var,

 

/\

Receiver Variable

\/

39ð, .3/

/\

Receiver Length

\/

"JOBDð1ðð", .5/ /\

Format

Name

\/

qual_job_desc,

 

/\

Qualified Job Description

\/

&error_code);

 

/\

Error Code

\/

if(memcmp(received, "

 

", 7) == ð)

 

memcpy(hold_value, ((Qwd_JOBDð1ðð_t \)rec_var)->Hold_Job_Queue, 1￿ð);

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

/\ Let's tell everyone what the hold value was for this job. \/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ sprintf(command_string,

"SNDMSG MSG('HOLD value is %.7s') TOUSR(QPGMR)", hold_value);

system(command_string);

} /\ main \/

Retrieving

the

Hold Parameter

(Exception

Message)—ILE COBOL

Example

 

 

 

 

 

 

 

 

 

Refer to “Retrieving the Hold Parameter (Exception Message)—OPM RPG

 

 

 

Example”

on

page 3-6

for the original example. The following program also

 

 

 

for

OPM

COBOL.

 

 

 

 

 

IDENTIFICATION DIVISION.

 

 

 

 

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

 

 

 

 

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

 

 

 

 

\

 

 

 

 

 

 

 

\Program Name:

JOBDAPI

 

 

 

 

\

 

 

 

B-4

System

API

Programming

V4R1

 

 

Page 282
Image 282
IBM Version 4 manual Message-ILE Cobol, Identification Division