Using INV and OUTV
Initiating and Communicating With Processes
5–18
107365 Tandem Computers Incorporated
Use the macro in Figure 5-8,
fup2
, to modify a FUP operation so that user requests
and FUP responses are recorded in a log file. The syntax is:
fup2
fup-command
where
fup-command
is a valid FUP command. The macro logs the request, the time
of the request, and the FUP output to a file called LOGFILE. The macro displays the
contents of LOGFILE before exiting.
Figure 5-8. Directing FUP Output to a Log File
?SECTION fup2 MACRO
#FRAME
#PUSH errvar,fupout,logvar,result == Create variables
== Open logfile for writing
SINK [#REQUESTER /WAIT/ WRITE logfile errvar logvar]
#APPEND logvar &
[#CONTIME [#TIMESTAMP]]: FUP %*% FROM TERMINAL [#MYTERM]
== Write a log record
$SYSTEM.SYSTEM.FUP /OUTV fupout/ %*% == Invoke FUP
[#LOOP |WHILE| NOT [#EMPTYV fupout] |DO|
== Retrieve FUP output
[#SET result [#EXTRACT fupout] ]
#APPEND logvar [result] == Write FUP result to logfile
]
SINK [#REQUESTER CLOSE logvar] == Close logfile
#OUTPUT The log contains:
FUP COPY logfile
#UNFRAME == Remove variables