Actually you can use the both files with the same record format in one
routine.
On the F Spec simply rename one of the record formats. This way the
fields don't change.
Then if you want to rename just one field, you use the I spec to rename
a field.
If you want to rename all fields use the prefix on the F Spec.
Assume both files have the format CHAMARA1R.
FCHAMARA1 IF E DISK
// CHARMARA1 has: SHAREDKEY and OTHERFLD and NUM1
FCHAMARA2 IF E DISK rename(Chamara1r: input)
// CHARMARA2 has: SHAREDKEY and OTHERCOL and NUM1
ICHAMARA1R NS 01
I SHAREDKEY XSHAREDKEY
The overlapping field would be NUM1. The data would be from the last
file read.
Where SHAREDKEY is from RA1 and XSHAREDKEY is from RA2.
Sharon Wintermute
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Chamara Withanachchi
Sent: Tuesday, January 13, 2009 8:40 AM
To: RPG Programming on the AS400 / iSeries
Subject: Re: Rename file field in RPGLE
Ok then fine I was talking about if both files were having same record
format. Then you cannot compile
Regards,
Chamara Withanachchi
Owner of www.rpgiv.info
WWW.RPGIV.INFO
Mob: +971 50 5698644
Tel: +971 6 5595887
chamaraw@xxxxxxxxxx
www.rpgiv.info
i want to be future ready. i want control. i want an i.
Sent from my BlackBerry(r) wireless device
-----Original Message-----
From: rob@xxxxxxxxx
Date: Tue, 13 Jan 2009 09:18:03
To: RPG programming on the IBM i / System i<rpg400-l@xxxxxxxxxxxx>
Subject: Re: Rename file field in RPGLE
No the files have different record formats. I am only renaming the
field
from one file, not both.
CREATE TABLE ROB/CHAMARA1 (SHAREDKEY CHAR (5 ) NOT NULL WITH DEFAULT,
OTHERFLD CHAR (5 ) NOT NULL WITH DEFAULT)
RCDFMT CHAMARA1R
CREATE TABLE ROB/CHAMARA2 (SHAREDKEY CHAR (5 ) NOT NULL WITH DEFAULT,
OTHERCOL CHAR (5 ) NOT NULL WITH DEFAULT)
RCDFMT CHAMARA2R
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.