HPlogo Interprocess Communication: Programmer's Guide: HP 3000 MPE/iX Computer Systems > Chapter 2 IPC Using Job Control Words and Other Variables

Job Control Word Intrinsics

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The following intrinsics are used to manipulate JCWs. Note that the first intrinsic affects only the predefined Job Control Word called JCW; the rest can be used with any JCW in the session variable table.

SETJCW

The SETJCW intrinsic is used to set the bits in the predefined Job Control Word JCW. A SETJCW intrinsic call could be:


   SETJCW(WORD); 

where WORD is a 16-bit logical value whose bits are set by you. If you set bit (0:1)=1, the system displays the following message when your program terminates, either normally or due to an error:


   PROGRAM TERMINATED IN AN ERROR STATE (CIERR 976) 

Bits (1:15) may be set to any pattern.

NOTE: In batch mode, the job is terminated unless the :CONTINUE command is used. If you have a JCW of exactly %140000 (bits (0:2) only), the "CIERR 976" message is replaced by "CIERR 989, PROGRAM ABORTED PER USER REQUEST". Refer to the MPE/iX Commands Reference Manual (32650-90003) for a discussion of :CONTINUE.

The predefined Job Control Word JCW can be read by a process with the GETJCW intrinsic. The form of the GETJCW intrinsic call is:


   JCW:=GETJCW 

The Job Control Word is returned to JCW.

For example, consider a job where two processes in the same process tree pass information to each other through JCW. In one process, you transmit the contents of the word PROCLNK to JCW. Process A sets JCW to PROCLNK as follows:


   SETJCW(PROCLNK); 

When process B is executed, it obtains the value of JCW through the GETJCW intrinsic. In this case, the contents of JCW are returned to the word STORELNK.


   STORELNK:=GETJCW; 

PUTJCW

The PUTJCW intrinsic is used to establish a user-defined JCW, or to change the value of an existing JCW. This intrinsic scans the variable table for the JCW name. The name of a user-defined JCW must be alphanumeric, must start with a letter, and must be between 1 and 255 characters long. If the JCW name is found, the value of JCW is updated to the value passed by PUTJCW. If not found, the JCW name is added to the table and assigned the value passed with the name. For example, the intrinsic call:


   PUTJCW(JCWNAME,JCWVALUE,STATUS);

searches the variable table for a name that matches the name contained in JCWNAME (a character array). If the name exists, its value is updated to the value contained in JCWVALUE. If the name is not found, the name is added to the table and assigned the value contained in JCWVALUE.

The STATUS parameter of PUTJCW indicates the status of the intrinsic call and returns an integer value to indicate this status, as follows:

0

Successful execution.

1

Error. JCWNAME is longer than 255 characters.

2

Error. JCWNAME does not start with a letter.

3

Error. The variable table is out of space.

4

Error. Attempted to assign a value to an MPE/iX-defined JCW value

mnemonic (OK, WARN, FATAL, or SYSTEM).

5

Error. Cannot assign a value to a system-reserved JCW (for example,

PUTJCW(HPMONTH )is illegal).

6

Warning. A standard variable has been reclassified as a JCW. (This happens

when a variable set with SETVAR has its value altered with PUTJCW or SETJCW.)

7

Error. Cannot reclassify predefined standard variables as JCWs (for example,

PUTJCW (HPPROMPT) is illegal).

FINDJCW

The FINDJCW intrinsic is used to scan the variable table for a JCW and return its value. Thus, the intrinsic call:


   FINDJCW(JCWNAME,JCWVALUE,STATUS);

searches the variable table for a JCW of the same name as that contained in JCWNAME. If found, its current value is returned in JCWVALUE. If not found, an error is returned in STATUS, and JCWVALUE is returned unchanged.

The STATUS parameter of FINDJCW indicates the status of the intrinsic call and returns an integer value indicating this status as follows:

0

Successful execution.

1

Error. JCWNAME is longer than 255 characters.

2

Error. JCWNAME does not start with a letter.

3

Error. The JCW named in JCWNAME does not exist.

For more information and full syntax descriptions for the above intrinsics, refer to the MPE/iX Intrinsics Reference Manual (32650-90028).

Feedback to webmaster