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



When working with QCMDEXC I've set it up as a prototyped procedure, and
use the SDS to help me trap errors.
So first I include the SDS

D ProgSDS SDS QUALIFIED
D ExceptAll 40 46A
etc...

Then I include the prototype to QCMDEXC:

D QCMDEXC PR ExtPgm('QCMDEXC')
D Cmd 2048A Options(*Varsize)
D CmdLen 15P 5

Then when I issue a command I do this:

C Eval MyCmd = 'DSPFD FILE(XYXYXYZ) ' +
C 'OUTPUT(*PRINT)'
C Eval MyCmdLen = %LEN(%TRIM(MyCmd))
C CallP(E) QCMDEXC(MyCmd:MyCMdLen)

C If %ERROR
C Eval MyErrMsg = ProgSDS.ExceptAll
C Else
C Eval MyErrMsg = 'OK'
C EndIf
C MyErrMsg Dsply

~
The system data structure will have the error code in positions 40 to 46

As far as handling the file problem during the override, I agree with
others (yes Joe, you too *grin*) that adding USROPN to the file then
opening with Open(E) will allow you to trap any errors when opening the
file.

As an alternative to overriding to the file, you could add the keyword
EXTMBR(X) to the file definition where X is the member you want to
override too (note that the contents of X are case sensitive). This can
be a literal or a variable. You would probably still want to have USROPN
and test for errors to trap them.

Hope it helps

James P. Wiant
Testing Coordinator
Foodstuffs, Auckland, Ltd.





This message has been sent from Foodstuffs (Auckland) Limited ("Foodstuffs").

The information contained in this message and or attachments
is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other
use of, or taking of any action in reliance upon, this
information by persons or entities other than the intended
recipient is prohibited. If you received this in error,
please contact the sender and delete the material from any
system and destroy any copies.

The views and opinions expressed in this message may be those
of the individual and not necessarily those of Foodstuffs,
and are not given or endorsed by it.

Please note that this communication does not designate an
information system for the purposes of the Electronic
Transactions Act 2002.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.