× 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.


  • Subject: Re: RPG: add file with same name from different AS/400 into pgm
  • From: Anton Gombkötö <Gombkoetoe@xxxxxxxxxx>
  • Date: Thu, 27 Jan 2000 07:42:23 +0100

There's no checking on OVRDBF.

I have a similar task, but i monitor the OPEN in RPG.

My task is to access a customer file via DDM. The second machine may be
down, then i want to use a local copy.

So i start the RPG, override to the DDM-file, try to open it.
when this fails, i override to the local file and open it.

0.02 Euro

Anton Gombkötö


----- Original Message -----
From: "Jim Langston" <jlangston@conexfreight.com>
To: <RPG400-L@midrange.com>
Sent: Thursday, January 27, 2000 3:43 AM
Subject: Re: RPG: add file with same name from different AS/400 into pgm


> I would create a CL front end, and check for the availability of the
> files before I even ran the RPG.  Then I would do over rides dependent
> on what files where there. In your RPG you would call them something
> like Order1 and Order2, and over ride both of them (you only need to
> over ride one, but I don't' think you want to change the file name on
> your
> system just to match the cleaner name in your RPG).
>
> I'm not sure how to check for the availability of a DDM file, but if
> things
> are nice, it would fail on the OVRDBF.  Then do a MONMSG.  Something
> like:
>
> OVRDBF Order1 OrderFile
>
> OVRDBF Order2 OrderDDM
> MONMSG(CPF0000) DO
>   CHGVAR DDMEmpty 'Y'
>   OVRDBF Order2 OrderEmpty
> END
>
> Then call your program passing the DDMEmpty parameter
> (which is a 'Y' if it couldn't find the DDM file).
>
> Where OrderEmtpy is just a copy of your ORDER file with no
> records.
>
> Now, in your RPG program, you open both:
>
> FOrder1    UF   E            K      Rename(OrderPF:OrderPF1)
> FOrder2    UF   E            K      Rename(OrderPF:OrderPF2)
>
> Then you can use the order on your local DASD as OrderPF1 and
> the other file (either the DDM on a remote system, or a local black
> file) as OrderPF2.  You would need to implement program logic to
> look at the DDMEmpty parameter to see whether to use OrderPF2
> or not.
>
> Regards,
>
> Jim Langston
>
> "Stone, Joel" wrote:
>
> >
> >
> > I need to add an order file to a inquiry RPG pgm.  The file has the
> > same name as a file already in the pgm.  What is an easy way to
> > accomplish this???
> >
> > Only one of the files must be open at any point in time, but a user
> > could look at one file and then the other in the same session.
> >
> > Call qcmdexc to ovrdbf and re-open the file with each read to the
> > orders?
> >
> > Note: I dont think I can use an LF to combine the files, because the
> > second file is on another box using DDM, which is sometimes down.  If
> > the DDM file is down, I still want the user to be able to see his
> > local orders!
> >
> > Thanks!
>
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
david@midrange.com
> +---

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.