|
And what if the error is that the file exists but you don't haveauthority
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.your
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:
captureFrom: 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
file.this error?(Or is there any other way of doing it)
Derek, the override command (OVRDBF) doesn't actually check for the
It simply tells the operating system that any programs trying to openfile
ABC should instead open MPPMP100 in DXGO. (I assume you meant that
youTOFILE is DXGO/MPPMP100.)At
An error doesn't actually occur until a program tries to open file ABC.
that point, the operating system sees the override and attempts to openthe
TOFILE. Typically, this is when your RPG program first loads (or if
listhave defined the USROPN keyword for the file, it happens when you issuethe
OPEN opcode to the file).could
The easiest way to handle this is probably with a USROPN file. You
put an error indicator on your OPEN statement, or put a MONITOR blockaround
it.list
Joe
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
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
To post a message email: RPG400-L@xxxxxxxxxxxxlist
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
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 mailing list archive is Copyright 1997-2025 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.