|
|
SNA IMF Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 Intrinsics Used with Standard MPE
I/OWRITESTREAM |
|
WRITESTREAM creates the data stream that your program on the HP 3000 sends to the host (LU.T2 emulation only).
The WRITESTREAM intrinsic can be used only during LU.T2 emulation and only in transparent mode. To open a device in transparent mode, call the OPEN3270 intrinsic with bit 14 of the flags parameter set to 1. To send data to the host, call WRITESTREAM to create the data stream, then call TRAN3270 to transmit it to the host. WRITESTREAM accepts an array of characters destined for the host and puts these characters into your internal screen image. You must supply the terminal identifier, the array of characters, and the number of characters in the data stream. The maximum length of the outbuf string (and the maximum value for the outbuflen parameter) is as follows: 540 bytes for 480-character screens 2160 bytes for 1920-character screens 3870 bytes for 3440-character screens After your application receives the initial screen from the host (for example, the CICS or TSO welcome screen), it is communicating over the LU-SSCP session. At this point, data you write to the internal screen image with the WRITESTREAM intrinsic will be appended to the end of the data received from the host. When you call TRAN3270 to transmit the internal screen image to the host, data is read starting from the first position after the last data received from the host. Therefore, you must set the offset parameter of the WRITESTREAM intrinsic to the length of the last data stream received from the host. (The offset in your WRITESTREAM call should equal the actinbuflen from your last call to READSTREAM). An offset of zero would place the data at the beginning of the internal screen image, before the position where reading begins, and an empty RU would be sent to the host. After the BIND, when the LU-LU session has been established, the internal screen image is read from the beginning (position 0). When you call TRAN3270, the entire screen image, beginning at position 0, is transmitted to the host. Therefore, while your application is communicating over the LU-LU session, you should set the offset parameter of the WRITESTREAM intrinsic to 0. If you make multiple calls to WRITESTREAM before you call TRAN3270, each write must begin where the last one left off. In other words, the offset of the second WRITESTREAM call should be the outbuflen value from the first call, the offset of the third call should be the sum of the outbuflen values from the previous two calls, and so on. When sending data to the host, your WRITESTREAM buffer needs to contain only the data to be transferred. SNA IMF divides this data into frames and adds the SDLC and SNA protocol headers. The AID key and cursor address, which you specify in your call to TRAN3270, are inserted at the front of the first frame. You can suppress insertion of the AID key and cursor address in transparent mode. See the description of TRAN3270, earlier in this chapter, for more information. If cursor suppression is not used, and you are sending the [CLEAR] key or a PA key during an LU.T2 session, call WRITESTREAM with an outbuf of length zero before calling TRAN3270. In transparent mode, SNA IMF will not check the AID key to determine whether it is the [CLEAR] key or a PA key. In non-transparent mode, no data is sent with the [CLEAR] or PA keys. Call WRITESTREAM only in transparent mode. See Chapter 2 “Using SNA IMF Intrinsics” for information about transparent mode. CALL "CWRITESTREAM" USING TERMINALID OFFSET OUTBUFLEN OUTBUF RESULT. (on MPE V and in compatibility mode on MPE XL) CALL INTRINSIC "WRITESTREAM" USING TERMINALID OFFSET OUTBUFLEN OUTBUF RESULT. (in native mode on MPE XL) All parameters are numeric data items except OUTBUF, which is an alphanumeric data item. CALL WRITESTREAM (TERMINALID, OFFSET, OUTBUFLEN, OUTBUF, RESULT) All parameters are integer variables except OUTBUF, which is a character array. CALL BWRITESTREAM (T, O1, L9, O$, R) (on MPE V and in compatibility mode on MPE XL) CALL WRITESTREAM (T, O1, L9, O$, R) (in native mode on MPE XL) All parameters are integer variables except O$, which is a string variable. WRITESTREAM (TERMINALID, OFFSET, OUTBUFLEN, OUTBUF, RESULT) All parameters are integer data items except OUTBUF, which is a byte array. WRITESTREAM (TERMINALID, OFFSET, OUTBUFLEN, OUTBUF, RESULT); All parameters are short integer variables except for OUTBUF, which is a packed array of char. WRITESTREAM (&TERMINALID, &OFFSET, &OUTBUFLEN, OUTBUF, &RESULT); All parameters are of type short, except OUTBUF, which is an array of characters (a pointer to a char). Following are excerpts from a Pascal program that calls SNA IMF intrinsics. For examples of complete Pascal programs in non-transparent and transparent modes, see Appendix F “Sample Programs”
|
|