Copy Presentation Space (5)

Top  Previous  Next

The Copy Presentation Space function copies the contents of the host-connected presentation space into a data string that you define in your EHLLAPI application program.

 

The Copy Presentation Space function translates the characters in the host source presentation space into ASCII. Attribute bytes and other characters not represented in ASCII normally are translated into blanks. If you do not want the attribute bytes translated into blanks, you can override this translation with the ATTRB option under the Set Session Parameters (9) function.

 

3270

5250

Yes

Yes

 

 

Prerequisite Calls

 

Connect Presentation Space (1)

 

 

Call Parameters

 

 

Standard Interface                              Enhanced Interface

Function Number

Must be 5

Data String

Preallocated target string the size of your host presentation space. This can vary depending on how your host presentation space is configured. When the Set Session Parameters (9) function with the EAB option is issued, the length of the data string must be at least twice the length of the presentation space.  DBCS Only: When the EAD option is specified, the length of the data string must be at least three times the length of the presentation space. When both the EAB and EAD options are specified, the length of the data string must be at least four times the length of the presentation space.

Length

NA (the length of the host presentation space is implied).

PS Position

NA.

 

 

Return Parameters

 

This function returns a data string, length, and a return code.

 

Data String

 

Contents of the connected host presentation space.

 

Length

 

Length of the data copied.

 

Return Code

 

The following codes are defined:

 

Return Code

Explanation

0

The host presentation space contents were copied to the application program. The target presentation space was active, and the keyboard was unlocked.

1

Your program is not connected to a host session.

4

The host presentation space contents were copied. The connected host presentation space was waiting for host response.

5

The host presentation space was copied. The keyboard was locked.

9

A system error was encountered.

 

 

Remarks

 

1.An EAB can be returned when the Set Session Parameters (9) function EAB option is used. EAB is related to each character in the presentation space and is returned preceding each character.
2.DBCS Only: The Set Session Parameters (9) function EAD option is used with this function to return a 2-byte EAD. If the EAD option is specified instead of the EAB option, EAD is returned preceding each character. If both the EAB and EAD options are specified, EAD is returned preceding the EAB. If the start position of the copy is at the second byte in the double-byte character, or the end position is at the first byte in the double-byte character, the bytes are translated into blanks.
4.The Copy Presentation Space function is affected by the following session options:
ATTRB/NOATTRB/NULLATTRB
EAB/NOEAB
XLATE/NOXLATE
BLANK/NOBLANK
DISPLAY/NODISPLAY
EAD/NOEAD (for DBCS only)
NOSO/SPACESO/SO (for DBCS only)
EXTEND_PS/NOEXTEND_PS
5.If you want to copy only a portion of the host presentation space, use the Copy Presentation Space to String (8) function.
6.To use this function, preallocate memory to receive the returned data string parameter. The statements required to preallocate this memory vary depending on the language in which your application is written.