Automation Engine Script Guide > Ordered by Function > Arithmetics > GET_BIT

GET_BIT

Script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,…: Checks if a bit is set in a bit field.

Syntax

GET_BIT(Number, Bit Position)

Syntax

Description/Format

Number 

Number to be converted into a binary format (bit field).
Format: Number or script variable
 

Bit position 

Position within the bit field which should be checked. 
Format: Number or script variableA placeholder for a value within a script..
 


Return code

"0" - Bit is set
"1" - Bit is not set

Comments

This scriptA particular Automation Engine object type. function converts the number - which is given with the first parameter - into a binary format. The result is a so-called bit field. Subsequently, it checks if the bit is set at the specified position.

The Bit Position is always counted from the right.

This script function is also used to request the 16 bit field MSG_DESCRIPTOR, MSG_LEVEL and MSG_MISC of a console message in z/OS. These can also be directly queried with the script function GET_CONSOLE.

Examples

In the first example, a check is made to determine if the 3rd bit is set in the bit field ("110"). This bit field is the binary format of the number "6". The returned value "1" (bit set) is output to the activation protocol.

:SET &RET# = GET_BIT(6, 3)
:
PRINT &RET# 

The second example demonstrates checking a componentA component is a single deployable application artifact. As an example, this can be yourfile.war to be deployed into a Tomcat container. Each component has different properties which determine where to get it from, how to configure it, etc. You will need one component per application artifact: e.g., one for the application tier and one for the database backend. of the console message in z/OS. The returned number is subsequently converted to binary and checked in bit position 3.

:SET &RET# = GET_CONSOLE("MSG_DESCRIPTOR")
:
SET &RET# = GET_BIT(&RET#, 3)

 

See also:

Script element Description

GET_CONSOLE

Reads message data of an occurred console eventAction that is triggered if particular conditions apply. It can be an Automation Engine object type or an entry in a Policy Orchestrator EventBase..

Script Elements - Arithmetics

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function
 

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH