beautypg.com

Objid, Objid, ob, Bjid, o – Visara Master Console Center Scripting Guide User Manual

Page 154

background image

Chapter 5 Script Commands

Scripting Guide

154

OBJID

Syntax:

OBJID( %Class, $ObjKeyExpr) ==> %ObjectID

Description:

Returns the ID (unique only for the particular script thread) for a MCC

object.

Action:

The ID (ObjID) for the object specified by the ObjKeyExpr parameter in

the class specified by the Class parameter is returned.

Parameters:

%Class. Numeric expression. The icon class of the lowest level

(target) object specified in the ObjKeyExpr parameter. Valid classes

are CPU, OS, MVSAGENT (see below), and SW. Refer to Icon
Class/Icon Name
on page 29.
$ObjKeyExpr. String expression. The object key expression. Refer to
Object Key on page 25 for more information.

Returns:

Numeric value. If OBJID() succeeds, %ObjectID will be the Object ID
assigned to the object. If an error occurs, %ObjectID will be the value

ERROR. If %ObjectID is ERROR, the ERRORNUM() function returns

one of the following values:
Manifest Constant

Description

Err_BadArgs

$ObjKeyExpr does not resolve to an

object

that

matches

%Class.

1001

%Class is not CPU, OS, or SW.

Refer to Object ID on page 25 for more information.

Notes:

1. If OBJID() is called with an invalid object key expression,

%ObjectID is set to -1 (ERROR).

2. The MVSAGENT class is required when using QREAD to read

messages from the MVS agent. Essentially, this treats the MVS

agent as a printer:
%oid := OBJID(MVSAGENT, "ECS OS")
%objids[1] := %oid
%qid := QOPEN(%objids)
// read from the printer Q
$text := QREAD(%qid, $msgarray, 0)
LOG(LOG_EXEC, "text = " + $text)

Example:

//=========================================
//EXAMPLE 1: SW (task) ObjID
/=========================================
//This gets an ObjID for the cron task, running
// on the Solaris OS, on the Webserv cpu
$CronExpr := “WEBSERV:SOLARIS:CRON”
%CronID := OBJID( SW, $CronExpr)
//=========================================
//EXAMPLE 2: OS ObjID
//=========================================
//This sample an ObjID for the BETA OS,
// running on the 9672-1 CPU
$BetaExpr := “9672-1:BETA”
%BetaID := OBJID( OS, $BetaExpr)
//=========================================
//EXAMPLE 3: OS ObjID array, for use with QOPEN
//=========================================