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



On 11 Sep 2013 13:39, John McKee wrote:
This code appears to work. Except when I try to use it. Too long a
story.

This is an RPG III program.

CALL 'QCMDEXC' 60
PARM CL,1
PARM XXCLEN

The first parm is an ALCOBJ command. As far as I know, this code
works great, and has for many years. This is vendor code.

Simple question (I think): Is 60 getting turned on if the ALCOBJ
command fails? Command attempts to set an *EXCL lock.

Personally, I would have the CALL invoke a CL program that performs the request. Having the CLP compiled with LOG(*JOB) can then have the request message toggled on when debugging the effects... and the CL MONMSG can more directly respond to a failing command or the CLP could be coded to allow the CL Default Handler inquire with CPA0701 when the command does not operate with success. Anyhow...

I do not know RPG III from RPG IV :-) , but for a RPG/400 program, the RPG/400 run-time will process the error condition for a failed command invocation and assign any indicators accordingly; i.e. if the LO\Low-resulting-indicator [columns 56-57] that diagnoses an "error condition" is specified for the CALL OpCode [for the CALL QCMDEXC], then that indicator will be set to *ON.

The following program source will issue the first CL command (ALCOBJ) in the Compile-Time array, and if the CALL and its CL command complete without error then the *IN60 is set to *OFF and thus the second CL command (DLCOBJ) is issued to undo the prior request, whereas if the CL command requested to be issued by the CALL fails with an error then the third CL command (DSPJOBLOG) is issued to show what errors had been issued and logged:

E CL 1 3 60
C Z-ADD60 CLEN 155
C*..1....+....2....+....3....+....4....+....5....+....6....+....7
C CALL 'QCMDEXC' 60
C PARM CL,1
C PARM CLEN
C*
C *IN60 IFEQ *OFF
C CALL 'QCMDEXC' 60
C PARM CL,2
C PARM CLEN
C ELSE
C CALL 'QCMDEXC' 60
C PARM CL,3
C PARM CLEN
C ENDIF
C*..1....+....2....+....3....+....4....+....5....+....6....+....7
C*
C SETON LR
**
ALCOBJ ((QGPL/QRPGSRC *FILE *EXCL MBRX)) WAIT(6)
DLCOBJ ((QGPL/QRPGSRC *FILE *EXCL MBRX))
DSPJOBLOG



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.