Previous Topic: Call cawto in the PARM Statement

Next Topic: Integration with CA OPS/MVS

Call cawto from a Script

Here is an example of calling cawto from within a script:

//EXPAND EXEC PGM=BPXBATCH,REGION=0M,
// PARM='PGM /cai/nsmem/bin/myscript Hi from a script file'
//STDOUT 	DD PATH='/cai/nsmem/tmp/batch.out',
// 		PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// 		PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIWGRP,SIROTH)
//STDERR 	DD PATH='/cai/nsmem/tmp/batch.err',
// 		PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// 		PATHMODE=(SIRUSR,SIWUSR,SIRGRP,SIWGRP,SIROTH)
//STDENV 	DD PATH='/cai/nsmem/tmp/ENVFILE',
// 		PATHOPTS=(ORDONLY)
/*
//*

The file myscript could do the following:

#Change to our directory
cd /cai/nsmem
# Set the environment variables
. PROFILE
# Take the parm passed as the message to be sent
cawto $*
# Send a copy of the command to the console
logger message $* sent