HP TACL Programming Manual page 99

Tandem advanced command language
Table of Contents

Advertisement

Figure 4-5. Copying Records From One File to Another File (Page 2 of 2)
[#IF open_err = 0 |THEN|
#OUTPUT [dest] opened successfully
|ELSE|
#OUTPUT [dest] not open; error [write_err]
SINK [#REQUESTER CLOSE read_var]
#RETURN
]
== Initiate read and write operations.
#SET read_err 0
[#LOOP |DO|
== Start the read.
#APPEND prompt_var READIT
== Wait for read_var or read_err to change.
#SET ready [#WAIT read_var read_err]
== If read_var changed, the read was successful.
[#IF [#MATCH read_var.* [Ready]] |THEN|
== Wait for the last write to complete
SINK [#WAIT write_var]
== Move the record into write_var to initiate the
== write operation.
#EXTRACTV read_var write_var
]
|UNTIL| ([read_err])
]
== end of #loop
== Wait for the last write operation to finish.
SINK [#WAIT write_var]
== Close both files and terminate the #REQUESTER
== functions.
SINK [#REQUESTER CLOSE read_var]
SINK [#REQUESTER CLOSE write_var]
|2|
#OUTPUT *** Error:
]
|2|
#OUTPUT *** Error:
]
#UNFRAME
The #EXTRACTV call that performs the write operation clears the contents of
read_var and write_var. TACL moves a record out of read_var and into
write_var. After TACL writes the data, TACL deletes the record from
write_var.
107365 Tandem Computers Incorporated
== initialize read_err
Invalid destination filename ***
Invalid source filename ***
Accessing Files
Copying Records Between Files
== close source
4–11

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents