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



Rob,

You'll have to loop back up the message chain. Something like this...

CHGATR is run
MONMSG MSGID(CPFB414) EXEC(Do)
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*LAST) MSGKEY(*NONE) WAIT(0) RMV(*NO) MSGID(&MSGID) KEYVAR(&KEYVAR) RTNTYPE(&RTNTYPE)
FindMsg:
IF ( (&RTNTYPE = '17') *OR (&RTNTYPE = '02') ) THEN(Do)
DMPCLPGM
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*PRV) MSGKEY(*NONE) WAIT(0) RMV(*NO) MSGID(&MSGID) KEYVAR(&KEYVAR) RTNTYPE(&RTNTYPE)
GOTO FindMsg
ENDDO
ENDDO

To specify a stop point you can send your own program message just before CHGATR executes.

SNDPGMMSG MSGID(yourmsgid) MSGF(yourlib/your msgf) MSGTYPE(*INFO)
CHGATR is run
MONMSG MSGID(CPFB414) EXEC(Do)
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*LAST) MSGKEY(*NONE) WAIT(0) RMV(*NO) MSGID(&MSGID) KEYVAR(&KEYVAR) RTNTYPE(&RTNTYPE)
FindMsg:
IF ( &MSGID *NE 'yourmsgid' ) THEN(Do)
DMPCLPGM
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*PRV) MSGKEY(*NONE) WAIT(0) RMV(*NO) MSGID(&MSGID) KEYVAR(&KEYVAR) RTNTYPE(&RTNTYPE)
GOTO FindMsg
ENDDO
ENDDO

And of course you can receive the CPFB414 message data and check the second value to see if any objects did not change before looping through messages.

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Wednesday, September 17, 2014 11:47 AM
To: midrange-l@xxxxxxxxxxxx
Subject: CL: Identifying the 'real' message.

I am running the CHGATR command on a directory. The escape message being thrown is
CPFB414 - Attributes changed for 0 objects. 1 objects not changed.
I have to look at the previous message to determine if the error was because the directory did not exist, or, I did not have authority to it.

How do I do this programmatically?
PGM
DCL &KEYVAR *CHAR 4
DCL &MSGID *CHAR 7
chgatr '/barneyphil' atr(*alwsav) value(*no) MONMSG CPFB414 EXEC(DO) /* Object not changed */
/* Figure out why the object was not changed. Might not exist, or you may +
not have authorization to it. +
Retrieve detailed message indicating why the object was not changed.
*/
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*EXCP) MSGKEY(*NONE) +
WAIT(0) MSGID(&MSGID) KEYVAR(&KEYVAR)
DMPCLPGM /* &MSGID=CPFB414, &KEYVAR=X'40404040' */ EndDo
END:
ENDPGM


Rob Berendt

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.