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




Well in the instance of NOT having the necessary authority, the situation
in this instance is STILL the same. The file CANNOT be accessed, therefore
an error. However, with the system() api, you can check the field ErrorCPF
to see what the CPF message was.


Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx
"If you're going through Hell, keep going" - Winston Churchill

rpg400-l-bounces@xxxxxxxxxxxx wrote on 05/30/2007 10:34:14 AM:

And what if the error is that the file exists but you don't have
authority
to it? You must be like me, and have *ALLOBJ. The other developers here

probably have me labeled as Dilbert's "Mordac - Preventer of Information
Services" because I make them test stuff as the users would see it. That

is when you use ErrorCPF.

Then again, as the other person suggested, you could just as easily use
USROPN and check the status from that. Instead of all the rubbish from
CHKOBJ. I guess it all comes down to choices, and yours is a valid
choice.

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





Alan Shore <AlanShore@xxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/30/2007 08:39 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
cc

Fax to

Subject
RE: Does Qcmdexc return an error ??






Another way is by using the system() API
Use the following code

// Execute Command (system) Subprocedure Variables
D As400cmd PR 10I 0 ExtProc('system')
D CmdText * Value Options(*String)
D
D ErrorCPF S 7A Import('_EXCP_MSGID')
D ErrorFlag S 10I 0 Inz(0)

C eval Errorflag = As400cmd('CHKOBJ -
C QTEMP/UPSELLWRK *FILE')
C if ErrorFlag = 0
C eval Errorflag = As400cmd('OVRDBF -
C etc....')
C endif

Where Errorflag of 0 means that the system() command was successful

rpg400-l-bounces@xxxxxxxxxxxx wrote on 05/30/2007 08:29:55 AM:

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.

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