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



I've used this in the past.



D/COPY QSYSINC/QRPGLESRC,QUSEC

* Defined Fields Used For Return Variables
D/COPY QSYSINC/QRPGLESRC,QUSROBJD

D ChkObj PR ExtPgm('QUSROBJD')
D ReturnVaribl 527
D ReturnLen 9B 0
D FormatName 8 CONST
D Obj_Lib 20 CONST
D ObjType 10 CONST
D ErrorParm 16

D ReturnVaribl S 527
D ReturnLen S 9B 0 Inz(%Size(ReturnVaribl))
D FormatName S 8 Inz('OBJD0400')
D Obj_Lib S 20 Inz('MPPMP100 DXGO ')
D ObjType S 10 Inz('*USRPRF ')

C Eval QUSBPRV = %Size(QUSEC)

C CallP ChkObj( ReturnVaribl :
C ReturnLen :
C FormatName :
C Obj_Lib :
C ObjType :
C QUSEC )
C If QUSERVED <> ' '
* Error Occured
C Dump
C Else
* No Error Occured
* Load Object Information Fields
C Eval QUSD0400 = ReturnVaribl
C EndIf

* End Program
C Eval *InLr = *On


Michael Schutte
Admin Professional
What's the secret? Find out at your Bob Evans Restaurant on May 17!


rpg400-l-bounces@xxxxxxxxxxxx wrote on 05/30/2007 08:34:54 AM:


Sorry Joe,

I guess i typed it wrong.
My from file and to file are the same.
OVRDBF FILE(MPPMP100) TOFILE(DXGO/MPPMP100)
The requirement of my program is that, if file MPPMP100 does not exist in

DXGO, then an error message should be written to the printer file.Any
suggestions for this??


From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
Reply-To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx>
Subject: RE: Does Qcmdexc return an error ??
Date: Wed, 30 May 2007 07:29:55 -0500

From: derek gonsalves

Hi,

I have a Qcmdexc statement in a program.
OVRDBF FILE(ABC) TOFILE( )
Now for eg.
the TOFILE is DXGO/ABC. If MPPMP100 does not exist in DXGO, can i
capture
this error?(Or is there any other way of doing it)

Derek, the override command (OVRDBF) doesn't actually check for the
file.
It simply tells the operating system that any programs trying to open
file
ABC should instead open MPPMP100 in DXGO. (I assume you meant that your
TOFILE is DXGO/MPPMP100.)

An error doesn't actually occur until a program tries to open file ABC.
At
that point, the operating system sees the override and attempts to open
the
TOFILE. Typically, this is when your RPG program first loads (or if you
have defined the USROPN keyword for the file, it happens when you issue
the
OPEN opcode to the file).

The easiest way to handle this is probably with a USROPN file. You
could
put an error indicator on your OPEN statement, or put a MONITOR block
around
it.

Joe

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


_________________________________________________________________
More photos, more messages, more storage—get 2GB with Windows Live
Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-
us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507

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