Where the trigcond macro is – HP NonStop G-Series User Manual
Page 83
Triggers
HP AutoSYNC User’s Guide—522580-016
6-5
TRIGGER examples
where the TRIGCOND macro is:
========================================================
== Name: TRIGCOND
== Purpose: Sample conditional sqlcomp depending on file
== code and OS version
== Usage:
== SYNC $data.test.sqobj TO \paris.$datab.testb.sqobj,
== TRIGGER "RUN TRIGCOND #SYNCFILE";
==
==
========================================================
?tacl macro
#frame
== Setup
==
#push file^code release sqlcomp_out tos^version
#SET TNSR Q [#push TNSR] == result from #TOSVERSION
#SET TNSE R [#push TNSE]
== configure SQL catalog
#set my^catalog MYCATLG [#push my^catalog]
== pick up the tacl parameter(s) from the trigger command
#set SYNCFILE %1% [#push SYNCFILE]
=========================================================
== get file code and OS version
#set file^code [#fileinfo /code/ [syncfile]]
#setmany tos^version release, [#tosversion]
== perform conditional SQLCOMP
[#case [file^code]
|100| == compiles on TNS/R or TNS/E
sqlcomp /outv sqlcomp_out, in [syncfile]/ catalog [my^catalog]
#outputv sqlcomp_out == forces display for recording in logfile
|700| == compiles only on TNS/R
[#if tos^version '=' "[TNSR]" |then|
sqlcomp /outv sqlcomp_out, in [syncfile]/ catalog [my^catalog]
#outputv sqlcomp_out == forces display for recording in logfile
|else| #output [syncfile] not compiled - code 700 invalid on TNS/E
]
|800| == compiles only on TNS/E
[#if tos^version '=' "[TNSE]" |then|
sqlcomp /outv sqlcomp_out, in [syncfile]/ catalog [my^catalog]
#outputv sqlcomp_out == forces display for recording in logfile
|else| #output [syncfile] not compiled - code 800 invalid on TNS/R
]
|otherwise| #output Unknown file code
] {end case}
#unframe