Examples, Trigger examples – HP Integrity NonStop J-Series User Manual
Page 84

Triggers
HP AutoSYNC User’s Guide—522580-017
6-4
Examples
Examples
TRIGGER examples
1. SQL-compile the synchronized object file myslqprg.
SQLCOMP is invoked in the TACL macro sqlcmpme that sets up the defines for
the compilation:
2. Change the system name \sys1 to \sys2 in a synchronized edit file nodename:
3. Accelerate the synchronized object files in subvolume $data.tstobj:
4. Compare the old destination file with the new destination file: discrepancies will be
reported to the log file:
5. Conditionally SQL compile objects depending on the file code of the object file.
Only objects that can run on the destination are SQLCOMP’ed. The SYNC trigger
invokes a TACL macro TRIGCOND as follows:
SYNC trigtest.mysqlprg TO \sys2.$data.trigtest.*,
TRIGGER "sqlcmpme #syncfile", LOGFILE synctest.log;
Where sqlcmpme uses obey file mydefine before launching SQLCOMP:
?tacl macro
#frame
#push :file
#set :file %1%
system \sys02
obey mydefine
sqlcomp /in [:file], out $s.#sqlcomp/catalog \sys2.vol.subvol, explain,
currentdefines
#unframe
SYNC trigtest.nodename TO \sys2.$data.trigtest.*, LISTALL,
TRIGGER "edit /in trigin.updatsys/#SYNCFILE",LOGFILE synctest.log;
Where trigin.updatsys is:
cab/sys1/sys2/a;la
SYNC $data.object.* TO \tst.$data.tstobj.*, TRIGGER
“AXCEL #SYNCFILE, #SYNCFILE”;
SYNC /home/dev/sales/appl TO /E/paris/home/sales/appl/, LISTALL, LOGFILE
triglog, CLEAR, TRIGGER "/home/sales/scripts/cpsyrcv #SYNCFILE
#RECOVERFILE ";
cpsyrcv:
cp $1 /home/sales/bckupnew/;
cp $2 /home/sales/bckupold/;
SYNC $data.test.sqobj TO \paris.$datab.testb.sqobj,
TRIGGER "RUN TRIGCOND #SYNCFILE";