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

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

Join the forum, it's quick and easy

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

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

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

Go down

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

Post  maran 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.
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

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