HPlogo LU 6.2 API Application Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 5  Intrinsic Descriptions

TPStarted

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Initializes access to LU 6.2 API and allocates resources.

Syntax

              CA        I16    I32
TPStarted(LocalTPName, TPID, Status,
 
              I16         I16V          CA            CA        
          [TraceOn], [TraceSize], [TraceFile], [DefaultFile]);

Parameters

LocalTPName

Required; character array; input. This parameter is an 8-character array, left justified and padded with blanks. It identifies the name of the transaction program being executed. For remotely initiated TPs on MPE XL, this parameter must match the LocalTPName of the MCGetAllocate intrinsic.

TPID

Required; 16-bit signed integer; output. This number is assigned to the specific execution instance of the TP. (More than one instance of the same TP may be executing at once, and the TPID uniquely identifies a single instance of a TP.)

Status

Required; 32-bit signed integer; output. Indicates the result of intrinsic execution. See the "Status Parameter" section, earlier in this chapter, for more information.

TraceOn

16-bit signed integer; input. Indicates the type of intrinsic tracing, if any, to be enabled. Possible values are as follows:

0 = no tracing

1 = API intrinsic tracing

2 = APPC subsystem intrinsic tracing

3 = API and APPC subsystem intrinsic tracing

Default:

0 (no tracing)

NOTE: Specify TraceOn values of 2 and 3 only when asked to do so by your HP representative.
TraceSize

16-bit signed integer by value; input. This is a number from 1 through 32767 that specifies the maximum number of logical records in the user trace file. When the maximum number of records is reached, the first record is overwritten.

Default:

1024 logical records.

TraceFile

character array; input. This character array contains an actual file designator of the trace file to be used. The TraceFile parameter is used only when tracing is turned on with the TraceOn parameter. TraceFile can contain a fully qualified 35-character file name, with lockword, in the following form:

filename/lockword.groupname.acctname

The TraceFile array must be terminated with a blank. If the TraceFile parameter is used, the specified trace file is overwritten every time the TP is invoked. If more than one active TP specifies the same trace file name, or if you try to execute more than one instance of the same TP that references the file name, a status info value of -1033 will be returned.

Default: The default trace file name is PSTRACnn, where nn is a number from 00 through 49. The default trace file is created in the user's logon group and account. A new trace file is created every time TPStarted is called with tracing enabled.

DefaultFile

character array; output. This is a 28-character ASCII array, padded with blanks. It returns the name of the default trace file in the form PSTRACnn.group.account, where nn is a number from 00 through 49, and group.account is the user's logon group and account.

When user tracing is enabled, but the TraceFile parameter is not passed, you can use the DefaultFile parameter to get the name of the current trace file.

Description

The TPStarted intrinsic is executed only once within a TP. It allocates resources for the TP and allows the TP to establish conversations. When TPStarted is called, the LocalTPName is passed to LU 6.2 API. LU 6.2 API then assigns a TPID to the instance of the TP that called TPStarted. The TPID uniquely identifies each execution instance of a TP. If several users execute the same TP at the same time, every instance of that TP will have the same LocalTPName, but each instance will have its own TPID.

NOTE: For remotely initiated TPs on MPE XL, the LocalTPName parameter of the TPStarted intrinsic must match the LocalTPName parameter of the MCGetAllocate intrinsic.

The TraceOn parameter can have four possible values. When you are writing and debugging programs, it is useful to turn API intrinsic tracing on by setting the TraceOn parameter to 1. API intrinsic tracing is documented in Chapter 7 “Debugging” It will help you diagnose errors in your TP. Use TraceOn values of 2 and 3 only when asked to do so by your HP representative.

Since tracing can be turned on or off only during the execution of TPStarted, you might want to write your TP so that it will accept an info string that specifies the type of tracing to be performed. This would save having to recompile the program to change the type of tracing.

Status Info Values

 0     Successful Completion.
-1     Intrinsic called with parameter out of bounds.
-19    APPC subsystem is inactive.
-20    Not enough stack space for intrinsic to run.
-21    Insufficient memory space to allocate a conversation.
-90    An internal error in Presentation Services has occurred.
-95    Internal Error: Unable to create Transaction Program port.(MPE XL)
-1002  An internal error at the mapped conversation level has occurred.
-1003  Required parameter missing.
-1005  Insufficient Heap Space. (MPE V)
-1030  TPStarted request rejected.
-1033  Unable to open file specified in the 'TraceFile' parameter.
-1034  Out of range 'TraceSize' parameter specified in intrinsic call.
-1036  Out of range 'TraceOn' parameter specified in intrinsic call.
-1044  Multiple calls made to TPStarted.
Feedback to webmaster