GDSX Manual
Design and Development
Extended General Device Support (GDSX) Manual–134303
2-36
Using the Pseudo Procedures
See "GDSX Configuration Parameters" on page 2-42 for an explanation of how to set
configuration parameters.
Using the Pseudo Procedures
In a user task, you use ^BEGINTRANSACTION and ^ENDTRANSACTION to define
the elements of a transaction. When processing successfully completes for all elements
of the transaction, the transaction is said to be complete.
If any of the elements cannot be processed, the transaction is incomplete and an error is
returned to the user task. When an error is returned, the user task must determine what
to do next. One choice is to cancel the transaction with a call to
^ABORTTRANSACTION. Any elements of the transaction that were completed at the
time ^ABORTTRANSACTION is called are backed out of the system, as if the
transaction had never taken place. For example, data written to a database is removed
and the database is returned to the state it had before the new data changed it.
If a user task needs to suspend processing of a TMF transaction to do processing
unrelated to the TMF transaction, the transaction’s status can be changed to pending by
calling ^RESUMETRANSACTION with trans-begin-tag set to 0D. The user
task subsequently calls ^RESUMETRANSACTION with trans-begin-tag set to
the transid of the suspended transaction to change its status from pending to active.
An example of a GDSX application using the TMF pseudo procedures is given in
Appendix D. For more information on TMF and the counterpart procedures of the
pseudo procedures, see the NonStop TM/MP Application Programmer’s Guide.
Linked Lists
TSCODE maintains a number of two-way linked lists to tie together control blocks
associated with a task, a file open, an I/O request, and so on. The linked lists have a
structure identical to that used by the operating system. TSCODE provides standard
procedures for USCODE-maintained linked lists:
•
INIT^[X]LIST
•
INSERT^[X]ITEM
•
DELETE^[X]ITEM
See Section 8, “Service Routines,” for detailed descriptions of these procedures.
Knowing how to follow these lists is often helpful in debugging GDSX applications.
Each list has a header and a number of items that are linked together. The header of a
linked list has two parts, header[0] and header[1]. Header[0] contains the address of the
first item in the list. If the list is empty, header[0] contains its own address. Header[1]
contains the address of the last item in the list. If the list is empty, header[1] contains
the address of header[0].
header[0]: Address of first item in list. If list is empty, contains address of header[0].
header[1]: Address of last item in list. If list is empty, contains address of header[0].