Thanks for your reply Chuck
As in one of my earlier replies
The problem with this is that someone else may come along to maintain this
program. Even with detailed documentation within the program, there's no
guarantee that the other programmer will read it.
If I can just create a program that will compile/promote without having to
do something different from the norm, it will make life easier
CRPence
<CRPbottle@yahoo.
com> To
Sent by: rpg400-l@xxxxxxxxxxxx
rpg400-l-bounces@ cc
midrange.com
Subject
Re: D-spec using the same file name
11/17/2009 03:29 twice
PM
Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>
Establishing two separate Open Data Paths [ODP] allows using the
same file twice in the a HLL program; available since S/38. The
open & I/O would be directed against the same file [member & data],
as established by overrides from two separate /labels/ [names] in
the program F-specs, redirecting to the one file.mbr:
OVRDBF FILE1 TOFILE(TheLib/TheFile) MBR() SHARE(*NO)
OVRDBF FILE2 TOFILE(TheLib/TheFile) MBR() SHARE(*NO)
Both Declare [for compile] & Open [for run-time] the two separate
labels FILE1 & FILE2, both overridden to the one\same file, would
effect non-shared opens of the one file named TheFile in TheLib;
i.e. establishing two ODPs, as two separate OPENs in the program.
I am not entirely sure of the Declarative statements for
row.field data, but for having the separate /files/ from the
perspective of the RPG program, I presume it would be no different
than handling two files of the same name in different libraries.
That can be resolved with similar overrides, as alluded in a recent
thread on 10-Nov-2009; in part, by rename the record format of one.?
"Compiling a program with two files having the same name"
http://archive.midrange.com/rpg400-l/200911/msg00066.html
Regards, Chuck
Alan Shore wrote:
<<SNIP>>
Can you specify the same file name (physical or logical) more
than once in a program?
I want to process 2 separate records by using the same key, or do
I have to create a new logical with the same key as the file that
already exists?
<<SNIP>>
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.