× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Not at all, but your initial request was to be able to add records to a file
currently open for Input-only. Changing it to UPDATE/ADD is a different
scenario and usually you don't want to open for UPDATE simply to add records
because each READ to the file cause the record(s) to be locked.
-Bob


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Douglas W. Palme
Sent: Thursday, November 18, 2004 7:46 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Updating Records

Is there a reason not to add new reocrds and do updates at the same time?


"Bob Cozzi" <cozzi@xxxxxxxxx> wrote ..
> I would not recommend this approach. Use the File Additional option ("A"
> in
> column 20 on the F spec as others have suggested. This declares the file
> for
> Input and Output (but not update).
> 
>      FCUSTMAST  IF A E             DISK
> -Bob Cozzi
> 
> 
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
> On Behalf Of D.W. Palme
> Sent: Wednesday, November 17, 2004 9:54 PM
> To: 'RPG programming on the AS400 / iSeries'
> Subject: RE: Updating Records
> 
> I am not quite sure I understand what you mean by override?
> 
> 
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tony Carolla
> Sent: Wednesday, November 17, 2004 9:48 PM
> To: RPG programming on the AS400 / iSeries
> Subject: Re: Updating Records
> 
> 
> Blast it!  ignore my previous msg --  use this one:
> Declare it for update, with additions, i.e:
> 
>     FFilename  UF A E           K Disk
> 
> This way, you can read and/or write.  The other way would be to declare
> the same file twice, with different names:
> 
>     FFilename  IF   E           K Disk
>     FFile2     O    E           K Disk    ExtFile('LIB/FILENAME')
>     F                                     Rename(FmtName:FmtName2)
> 
> This way, you can use Filename to input, and File2 to output to.  The
> system should use blocking this way, so it might be faster.  When
> compiling this second method, you must override the FILE2 entry to point
> at FILENAME, ie.
> 
> OVRDBF FILE2 TOFILE(LIB/FILENAME)
> 
> Hope this helps
> 
> 
> On Wed, 17 Nov 2004 19:47:23 -0800, Tony Carolla <carolla@xxxxxxxxx>
> wrote:
> > Declare it for update, with additions, i.e:
> > 
> >      FFilename  UF A E           K Disk
> >      FFilename  IF   E           K Disk
> > 
> > This way, you can read and/or write.  The other way would be to 
> > declare the same file twice, with different names:
> > 
> >      FFilename  IF   E           K Disk
> >      FFile2     O    E           K Disk    ExtFile('LIB/FILENAME')
> >      F                                     Rename(FmtName:FmtName2)
> > 
> > This way, you can use Filename to input, and File2 to output to.  The
> > system should use blocking this way, so it might be faster.  When 
> > compiling this second method, you must override the FILE2 entry to 
> > point at FILENAME, ie.
> > 
> > OVRDBF FILE2 TOFILE(LIB/FILENAME)
> > 
> > Hope this helps
> > 
> > 
> > 
> > 
> > On Wed, 17 Nov 2004 21:40:42 -0600, D.W. Palme 
> > <dpalme@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > > I have a program that I am trying to write and I have made some 
> > > progress with this, but now I have run into something of which I am
> > > not sure how to handle.
> > >
> > > I have an F spec for a file as an INPUT file....so I can read some
> > > records from it.  When I try to define it as an Output file the 
> > > compiler burps and throws a fit LOL
> > >
> > > Since I need to both write new records to this file and still be 
> > > able to read it from within the same program can someone make a 
> > > suggestion on how to handle this for me?
> > >
> > > Thanks,
> > >
> > > Douglas
> > >
> > > --
> > > This is the RPG programming on the AS400 / iSeries (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.
> > >
> > >
> > 
> > 
> > --
> > "Enter any 11-digit prime number to continue..."
> > 
> 
> 
> -- 
> "Enter any 11-digit prime number to continue..."
> --
> This is the RPG programming on the AS400 / iSeries (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.
> 
> 
> --
> This is the RPG programming on the AS400 / iSeries (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.
> 
> 
> 
> --
> This is the RPG programming on the AS400 / iSeries (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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.