HP-UX SNAplus2 R7 APPC Programmer's Guide
Writing Transaction Programs
Basic Conversations
• A 2-byte GDS identifier (ID) field (for example, 0x12FF identifies the data as application data)
• A data field that can range in length from 0–32,763 bytes
The first four bytes are called the LLID.
If a logical record has multiple parts, the first part has the same format as a single record, and all subsequent parts
consist of the following fields:
• A 2-byte record length (LL) field
• A data field that can range in length from 0–32,765 bytes
The hexadecimal value for the LL field includes the two bytes for the LL field (and the two bytes for the ID field,
if it is present). For example, a single part GDS with no zero bytes of data has a value of
0x0004 for its LL field.
The LL field must be in high-low format, rather than byte-swapped format. For example, a length of 230 bytes is
represented as 0x00E6, rather than 0xE600.
Bit 0 of byte 0 of the LL (the most significant bit) is used to indicate length continuation (segmentation). The
following example shows ten bytes of data (each data byte has the value DD) split into three GDS segments. The
first and second segments each contain four bytes of data, and the last segment contains two bytes of data.
8008 12FF DDDD DDDD
8006 DDDD DDDD
0004 DDDD
The following values for the LL field are not valid (except when sending a PS header as described in Section 2.11.1,
Logical Records):
• 0x0000
• 0x0001
• 0x8000
• 0x8001
In a mapped conversation, the sending TP sends one data record at a time, and the receiving TP receives one data
record at a time. No record conversion is required of the TPs.
Sending PS Headers in Logical Records
If the conversation’s synchronization level is AP_SYNCPT, the application may need to send and receive data in the
form of PS Headers. The Syncpoint Manager is responsible for setting up the appropriate PS Headers to send to
the partner application, based on Syncpoint functions required by the application, and for performing the required
Syncpoint processing based on the PS Headers it receives from the partner application.
An LL field of 0x0001 indicates that the data is a PS Header; the sending application must specify an LL field of
0x0001 instead of specifying the length of the data field, and the receiving application must interpret the data as
a PS Header if it receives an LL field of 0x0001. If the conversation’s synchronization level is not AP_SYNCPT,
the value 0x0001 is not a valid LL field, and will be rejected.
2.11.2 Reporting Errors and Abends
In a basic conversation, a TP can indicate whether an error or abend (abnormal program termination) was caused
by a service TP or by a program using the service TP. This enables two communicating service TPs to distinguish
between errors they may have caused and errors that may have been caused by the programs they serve.
2.11.3 Error Log
In case of an error or abend in a basic conversation, a TP can send an error message, in the form of a general data
stream (GDS) error log variable, to the local log and to the partner LU.
74