RPGIV @ Work

A unique site for RPG and System i Lovers


Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Rename External File Field Names Print E-mail
User Rating: / 2
Written by Chamara Withanachchi   

You can use PREFIX keyword in F spec. this will allow users to rename/prefix externaly described fiel field names



FUserMast UF A E           K DISK    PREFIX(F1)

This will prefix all field names with F1


Suppose you want to remove n number of characters and replace them with some other charactor



FUserMast UF A E           K DISK    PREFIX(F1_ : 3)
This will prefix all field names with F1_ by replacing the first 3 characters of fields.


Rename selected fields in a externaly discribed file


You can use an external unqualified data structure.

In the following example the fields MyFld1 and MyFld2 in MyFile1 get renamed into RenFld11 and RenFld12. All other fields names stay unrenamed.


FMyFile1   if   e           k disk 
D DSFile1       E DS                  Extname(MyFile1)
		D  RenFld11     E                     ExtFld(MyFld1)
		D  RenFld12     E                     ExtFld(MyFld2)
<Previous   Next>