ILE C/C++ Programmer's Guide

Using Long Names for Files

The #pragma mapinc directive supports file names up to 128 characters long and record field names up to 30 characters long.

The LNAME option was added to #pragma mapinc to support SQL long name formats. SQL long names map to a 10-character short file name, which consists of the first 5 characters of the name followed by a 5-digit unique number. For example, the system short name for LONGSQLTABLENAME is LONGS00001.

Long record field names are not mapped to a 10-character short name. When the LNAME option is specified it is assumed that the long name format for the file name is being used. If the file name has more than 10 characters, this name is converted to the associated short name internally. This short name is used to extract the external file definition. When a regular short name of 10 characters or less is specified, no conversion occurs.

C language onlyThe #pragma mapinc directive uses the 30 character record field names in the type definitions that are generated, with or without the LNAME option that is specified. For the filenames that are specified using a long name format, the type definitions that are generated use the associated regular 10-character short filename.

C++ language onlyC++ users must use the GENCSRC utility to create type definitions from an external file.

C language onlyC users can use either the GENCSRC utility or the #pragma mapinc directive to create type definitions from an external file.

Note:
For more information on the differences between the GENCSRC utility and the #pragma mapinc directive, see Appendix A, The GENCSRC Utility and the #pragma mapinc Directive.


[ Top of Page | Previous Page | Next Page | Table of Contents ]