30.06.2013 Views

File Management - IBM

File Management - IBM

File Management - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Application program considerations for DBCS<br />

The following sections describe considerations for writing applications that process<br />

double-byte data.<br />

“Designing application programs that process double-byte data”<br />

“Changing alphanumeric application programs to DBCS application programs”<br />

Designing application programs that process double-byte data<br />

Design your application programs for processing double-byte data in the same<br />

way you design application programs for processing alphanumeric data, with the<br />

following additional considerations:<br />

v Identify double-byte data used in the database files.<br />

v Design display and printer formats that can be used with double-byte data.<br />

v If needed, provide DBCS conversion as a means of entering double-byte data for<br />

interactive applications. Use the DDS keyword for DBCS conversion (IGCCNV)<br />

to specify DBCS conversion in display files. Because DBCS work stations<br />

provide a variety of double-byte data entry methods, you are not required to use<br />

the AS/400 DBCS conversion function to enter double-byte data.<br />

v Create double-byte messages to be used by the program.<br />

v Specify extended character processing so that the system prints and displays all<br />

double-byte data. See “Extended double-byte characters” on page 203 for<br />

instructions.<br />

v Determine whether additional double-byte characters need to be defined.<br />

User-defined characters can be defined and maintained using the character<br />

generator utility (CGU). Information on CGU can be found in the ADTS/400:<br />

Character Generator Utility book.<br />

When you write application programs to process double-byte data, make sure that<br />

the double-byte data is always processed in a double-byte unit and do not split a<br />

double-byte character.<br />

Changing alphanumeric application programs to DBCS<br />

application programs<br />

If an alphanumeric application program uses externally described files, you can<br />

change that application program to a DBCS application program by changing the<br />

externally described files. To convert an application program, do the following:<br />

1. Create a duplicate copy of the source statements for the alphanumeric file that<br />

you want to change.<br />

2. Change alphanumeric constants and literals to double-byte constants and<br />

literals.<br />

3. Change fields in the file to the open (O) data type or specify the Alternative<br />

Data Type (IGCALTTYP) DDS keyword so that you can enter both double-byte<br />

and alphanumeric data in these fields. You may want to change the length of<br />

the fields as the double-byte data takes more space.<br />

4. Store the converted file in a separate library. Give the file the same name as its<br />

alphanumeric version.<br />

Appendix B. Double-byte character set support 211

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

Saved successfully!

Ooh no, something went wrong!