The RPQ Names Query reply is part of the IBM-defined 3270 Datastream Structured Replies. Typically it tells the host system which RPQs are installed in the control unit.
x3270 does not connect through a traditional control unit, so we can use the RPQNAMES structured field to return other information to the host.
As a samlpe, I provide some REXX code that interprets the data from the x3270 client. The X3270RPQ EXEC runs on VM/CMS and should also run on TSO unmodified. Use it as a starting point for extracting the RPQ items for your own use.
| Byte | Content | Content Description |
|---|---|---|
| 0-1 | L | Length of this structured field |
| 2 | SFID | 0x81 Identifies this structured field as a Query Reply |
| 3 | QCODE | 0xA1 Identifies this Query Reply as RPQ Names |
| 4-7 | DEVICE | Not used by x3270 - 0x00 00 00 00 |
| 8-11 | MODEL | Not used by x3270 - 0x00 00 00 00 |
| 12 | RPQL | Length of RPQDATA (includes this byte) |
| 13-n | RPQDATA | See below |
| Byte | Content | Content Description |
|---|---|---|
| 0-4 | ID | 'x3270' (EBCDIC) Identifies this RPQ as the x3270 terminal emulator |
| 5-n | RPQITEMS | Zero or more self-defining terms describing various attributes of the workstation. See below. |
The following self-defining terms are included by defining the X3270RPQ environment variable and assigning special keywords, or keyword=value pairs. Keywords must be separated by a colon (:).
| Byte | Content | Content Description |
|---|---|---|
| 0 | L | Length of this self-defining term (includes this byte) |
| 1 | TID | 0x00 Identifies this term as Workstation Address |
| 2-3 | FAMILY | AF_INET or AF_INET6 |
| 4-n | ADDR | binary device address in network-byte order |
The Workstation Address self-defining term is included when the X3270RPQ environment variable includes the ALL or ADDRESS keyword.
The address may be overridden by specifying one of the following forms of the address keyword:
| Byte | Content | Content Description |
|---|---|---|
| 0 | L | Length of this self-defining term (includes this byte) |
| 1 | TID | 0x01 Identifies this term as Program Timestamp |
| 2-8 | TIMESTAMP | Date & time x3270 was compiled, in BCD format (2 hex digits per byte) yyyymmddhhmmss |
The Program Timestamp self-defining term is included when the X3270RPQ environment variable includes the ALL or TIMESTAMP keyword. This term may not be overridden.
| Byte | Content | Content Description |
|---|---|---|
| 0 | L | Length of this self-defining term (Includes this byte) |
| 1 | TID | 0x02 Identifies this term as Work Station Time Zone |
| 2-3 | TIMEZONE | Signed number of minutes offset from UTC. |
The Workstation Timezone self-defining term is included when the X3270RPQ environment variable includes the ALL or TIMEZONE keyword.
The timezone may be overridden by specifying the timezone= form of the keyword:
| Byte | Content | Content Description |
|---|---|---|
| 0 | L | Length of this self-defining term (includes this byte) |
| 1 | TID | 0x03 Identifies this term as User Data |
| 2-n | UDATA | Free-form data |
The User Data self-defining term is included only when the X3270RPQ environment variable includes the USER keyword.
Data must be specified in one of two ways:
To send text data, the first two characters following user= must not be 0x nor 0X, otherwise x3270 will expect the following text to be valid hexadecimal digits. Since the colon (:) character separates keywords in the X3270RPQ environment variable, a colon to be included as part of the text must be preceded by a slash (/).
To send hexadecimal data, the first two characters following user= must be 0x or 0X. There must not be any whitespace before this 2-character prefix and the equal sign, otherwise the data will be interpretted as a text string, translated from ASCII to EBCDIC and sent to the host.
Data following the 0x (0X) prefix may contain whitespace, but must otherwise contain only the digits 0-9, or letters a-f in upper or lower case.
| Byte | Content | Content Description |
|---|---|---|
| 0 | L | Length of this self-defining term (Includes this byte) |
| 1 | TID | 0x04 Identifies this term as Program Version |
| 2-n | VERSION | A text string identifying the version of x3270. |
The Program Version self-defining term is included only when the X3270RPQ environment variable includes the ALL or VERSION keyword. This term may not be overridden.