Is this possible to use the long field name in RPG that is defined with ALIAS keyword in DDS?
Page 1 of 1
Is this possible to use the long field name in RPG that is defined with ALIAS keyword in DDS?
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.
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.
Similar topics
» What is a field type? List the 3 field types
» Why use the TEMPLATE keyword?
» IBMi DB2/400
» Parameter Passing with OPTIONS keyword
» KEEP & ASSUME DSPF Keywords.
» Why use the TEMPLATE keyword?
» IBMi DB2/400
» Parameter Passing with OPTIONS keyword
» KEEP & ASSUME DSPF Keywords.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|