How can we check for a particular monmsg in rpgle free format

120 pts.
Tags:
AS/400
AS/400 commands
MONMSG
QTEMP
QTEMP Library
RPGLE
I am trying to add qtemp library using command Command1='ADDLIBLE LIB(QTEMP)'; Callp(e) CmdExecution(Command1:%SIZE(Commandstat)); I am unable to check for various monmsg in case of error.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Vatchy
    Well, you shouldn't have to add QTEMP to your library list - it should already be there. However, you can check the program status data structure for the error message received; it will show you the error message in positions 40-46.
    1,410 pointsBadges:
    report
  • TomLiotta
    you shouldn’t have to add QTEMP to your library list - it should already be there. That depends on how the site sets up their library lists. Personally, I prefer having QTEMP at the top of user library lists. However, I also agree that it shouldn't be necessary to add QTEMP. Not because it might already be in the list, but because an explicit addition of QTEMP implies that QTEMP will be used. And if QTEMP is going to be used, then it can be used through explicit qualification. If, for example, you want to want to open a file named MYFILE in library QTEMP, then open "QTEMP/MYFILE". Don't rely on the library list. Just tell it to use QTEMP directly. Tom
    125,585 pointsBadges:
    report
  • VivekSharma
    I am accessing my as/400 program from web application through a stored procedure. In that case QTEMP is not present in our library list by default. So I was trying to add it in my RPG ILE free format code. Could anyone please help me on how how can we handle various MonMsg in our RPG ILE free format code? It would be of great help if i am given some sample code to refer.
    120 pointsBadges:
    report
  • TomLiotta
    In that case QTEMP is not present in our library list by default. I understand that it's not in your library list. What I wonder is why an RPG program needs QTEMP in the library list. A library doesn't have to be in a library list in order to use the library. You can use QTEMP whether it's in the list or not, just like any other library. Also, Vatchy already said that the error message identifier is in positions 40-46 of the program status data structure. Tom
    125,585 pointsBadges:
    report
  • Vatchy
    Maybe I wasn't too clear. When you code this: "Callp(e)" you are telling the program to NOT stop if there is an error message but to put the error message in the program status data structure. Immediately after the "Callp(e)" you check the program status data structure positions 40-46 for an error message and then do whatever processing you need for that particular message.
    1,410 pointsBadges:
    report
  • Splat
    Am I correct in assuming CmdExecution is a prototype for QCMDEXC? I would recommend using QCAPCMD if you need to execute commands in an RPG/ILE program - the API error data structure is populated at command execution and messages can be retrieved from same.
    7,055 pointsBadges:
    report
  • TomLiotta
    the API error data structure is populated at command execution... The same will happen with QCMDEXC. And neither of them need to be prototyped -- the CALL op-code allows the (E) extender, and it's the (E) extender that provides the PSDS exception data. Of course, QCMDEXC can also be prototyped if desired. However, QCAPCMD does have other advantages over QCMDEXC. But it's not as easy to use and there are many cases where QCMDEXC is all that's needed. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following