Using PREFIX to rename all fields in an external data structure in RPG AS400 |
In this blog, we will discuss the coding example of using the PREFIX keyword to rename all the fields of and externally described data structure in RPGLE Fixed, /Free and Fully free format
Coding for Rename all fields using PREFIX in an Externally described data structure
RPG Code in Fixed format for Renaming all fields in Externally Described Data Structure
D ds1 E DS EXTNAME(rpgle14pf:Rcdfmt14) D PREFIX(a1) C EVAL a1IDN = 2 C EVAL a1Name = 'DUMMY' C EVAL a1Addr1 = 'Address1' C EVAL a1Addr2 = 'Address2' C SETON LR C RETURN
RPG Code in /Free format for Renaming all fields in Externally Described Data Structure
* Externally described data structure * --> external definition used for ds. D ds1 E DS EXTNAME(rpgle14pf:Rcdfmt14) D PREFIX(a1) /Free a1IDN = 2; a1Name = 'DUMMY'; a1Addr1 = 'Address1'; a1Addr2 = 'Address2'; *inlr = *on; return; /End-Free
RPG Code in fully Free format for Renaming all fields in Externally Described Data Structure
**FREE DCL-DS DS1 EXTNAME('RPGLE14PF') PREFIX(a1); END-DS; a1IDN = 2; a1Name = 'DUMMY'; a1Addr1 = 'Address1'; a1Addr2 = 'Address2'; *inlr = *on; return;
Related Post
Read also :
- Data Structure and Types of DS in RPG AS400
- Using a Data Structure to subdivide the field in RPG AS400
- Using a Data Structure to group fields in RPG AS400
- Externally Described Data Structure in RPG AS400
- Using EXTFLD to code Externally Described DS in RPG AS400
- Define an externally-described data structure using the LIKEREC keyword in RPG AS400
- Difference between LIKEREC and EXTNAME keyword in RPG AS400
- Multiple Occurrence Data Structure in RPG AS400
- Data Area Data Structure in RPG AS400
- *LDA Local data area data structure in RPG AS400
- File information data structures (INFDS) in RPG AS400
- Indicator data structure in RPG AS400
- Program Status Data Structure in RPG AS400
- Using keywords QUALIFIED, LIKEDS, and DIM with data structures
- Array Data Structures in RPG AS400
- Defining Data Structure Parameters in a Prototype or Procedure Interface