You can use CAconsole to issue console commands from within the UNIX environment. This allows a message action to issue any required console commands directly without having to get automation into the process. The basic syntax of the command is as follows:
CAconsole [-attribute]
Indicates to return any output.
Indicates the amount of time to wait for response.
Indicates the text of the command.
Indicates to translate the command to upper case.
For example:
CAconsole -t5 -v -i”D OMVS,O”
In the following example, first determine if any job in a set of jobs is running. If any of the jobs is running, send an alert to a remote NSM machine and then cancel the job.
cd /cai/nsmem
# Set environment variables
. PROFILE
# Issue a Display Job,list command and place the output into a file display.out
CAconsole -I"D J,L" -V >display.out
# Search the output file for any job PRRP913x and place any hits into display1.out
grep PRRP913 display.out > display1.out
# If none are found send a message.
if [ $? = 1 ];then
cawto -n NSMI Job PRRP913 is not present
else
cawto -n NSMI Job is present, will cancel
# We need to parse the output to capture the job information.
cat display1.out | while read v1 v2 v3 v4 v5 v6 v7 v8 v9 vx ;
do
echo "$v1\n $v2\n $v3\n $v4\n $v5\n $v6\n $v7\n $v8\n $v9\n" >display2.out
job=`grep PRRP913 display2.out`
echo $job
job=`grep PRRP913 display2.out`
echo $job
CAconsole -I"CANCEL $job"
done
fi
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |