Converting String Literals in a Source File - IBM-ILE

You can convert the string literals in a source program from the point that the #pragma convert directive is specified to the end of the program.The #pragma convert directive specifies the CCSID to use for converting the string literals from that point onward in the program. The conversion continues until the end of the source or until another #pragma convert directive is specified.

If a CCSID with the value 65535 is specified, the CCSID of the root source member is assumed. If the source file CCSID value is 65535, CCSID 037 is assumed. The CCSID of the string literals before conversion is the same CCSID as the root source member. The CCSID can be either EBCDIC or ASCII.

Example

The following example shows you how to convert the string literals in T1520CCS to ASCII CCSID 850 even though the CCSID of the source physical file is EBCDIC.

Note: In this example, the TGTCCSID parameter is defaulted to *SOURCE.

  1. Type:
  2. CRTBNDC PGM(MYLIB/T1520CCS) SRCFILE(QCLE/QACSRC)

    To create the program T1520CCS using the following source:

    T1520CCS — ILE C Source to Convert Strings and Literals

    ILE C Source to Convert Strings and Literals

    The CRTBNDC command creates the program T1520CCS in library MYLIB. Program T1520CCS converts the EBCDIC string Hello World to ASCII CCSID 850.

  3. To run the program T1520CCS, type:
  4. CALL PGM(MYLIB/T1520CCS)

    The output is as follows

    output is as follows

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-ILE Topics