30.06.2013 Views

File Management - IBM

File Management - IBM

File Management - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

|<br />

Converting universal coded character set (UCS-2) graphic<br />

fields<br />

Using FMTOPT(*MAP) to copy to a UCS-2 graphic field converts the data in the<br />

from-field CSID to the CCSID of the UCS-2 graphic to-field. If the length after<br />

conversion is less than the length of the UCS-2 graphic to-field, the field is padded<br />

. If the length after conversion is greater than the length of the UCS-2 graphic<br />

to-field, the field is truncated.<br />

Using FMTOPT(*MAP) to copy from a UCS-2 graphic field converts the data from<br />

the CCSID of the UCS-2 graphic field to the CCSID of the to-field. If the length<br />

after conversion is less than the length of the to-field, the field is padded. If the<br />

length after conversion is greater than the length of the to-field, the field is<br />

truncated. Shift-out and shift-in characters are added around double-byte data<br />

except in DBCS-graphic and UCS-2 graphic fields.<br />

UCS-2 conversion possibilities also include variable length fields. Generally, the<br />

result length of a variable length to-field will be the minimum of the from-field<br />

converted length and the maximum length of the to-field.<br />

The CCSID conversions created when copying from or to a UCS-2 graphic field<br />

may cause the byte length of the data to be different after the conversion. The<br />

maximum length of the to-field is used to determine if all of the converted data<br />

will fit in the to-field.<br />

When copying from a UCS-2 graphic field to a character field, or to a DBCS-either<br />

field where the first byte is already converted to a valid SBCS character (not a<br />

shift-out X'0E'), any remaining characters that cannot be converted to SBCS (actual<br />

double-byte data in the UCS-2 field) will have a single-byte substitution character<br />

set in its place.<br />

When copying from a UCS-2 graphic field to a DBCS-only, DBCS-graphic field, or<br />

to a DBCS-either field where the first byte is already converted to a DBCS shift-out<br />

(X'0E'), any remaining characters that cannot be converted to DBCS will have a<br />

double-byte substitution character set in its place.<br />

In order for success when using FMTOPT(*MAP) to convert from or to UCS-2 data,<br />

the resulting converted data for the to-field must conform to the to-field type.<br />

Otherwise, conversion errors will occur and the to-field will be set to its default<br />

value.<br />

UCS-2 graphic fields restrictions<br />

The CPYF and CPYFRMQRYF commands with FMTOPT(*MAP) specified are not<br />

allowed when you copy from or to a UCS-2 graphic field unless the corresponding<br />

field is a UCS-2 or DBCS-graphic field (any CCSID including 65535), or is a<br />

character, DBCS-open, DBCS-either, or DBCS-only field with a CCSID other than<br />

65535. The only other corresponding type allowed to have a CCSID of 65535 is<br />

DBCS-graphic.<br />

The following parameters for the CPYF command do not support UCS-2 graphic<br />

fields:<br />

v FROMKEY(*BLDKEY) that refers to a UCS-2 graphic keyfield<br />

v TOKEY(*BLDKEY) that refers to a UCS-2 graphic keyfield<br />

v INCCHAR that specifies a UCS-2 graphic field name<br />

Chapter 4. Copying files 117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!