PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Is this possible to use the long field name in RPG that is defined with ALIAS keyword in DDS?

View previous topic View next topic Go down

Is this possible to use the long field name in RPG that is defined with ALIAS keyword in DDS?

Post  maran on Thu Dec 08, 2011 8:02 pm

Yes It is if you use V7R1.

For example

The code contains DDS for a database table (physical file):

A UNIQUE
A R CUSREC
A CUSTNBR 5P 0 ALIAS(CUSTOMER_NUMBER)
A CUSTNAME 20A ALIAS(CUSTOMER_NAME)
A CUSTCLASS 2A ALIAS(CUSTOMER_CLASS)
A K CUSTNBR

Under IBM i 7.1, the RPG compiler can access the long column names through an externally defined data structure.

D custDs e ds ALIAS
D QUALIFIED EXTNAME(custFile)
/free
custDs.customer_number = 12345;
custDs.customer_name = 'John Smith';
custDs.customer_class = 'AA';

As you see here, under 7.1, RPG can access long column names as data structure subfields.
avatar
maran
Admin

Posts : 442
Join date : 2009-07-24

View user profile http://pmsinformationsystem.forumotion.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum