Sending Job into MSGW

130 pts.
Tags:
AS/400
Batch jobs
MSGW
When a batch job is submitted, no system errors but there are no records in the file to process, I want to send the job into MSGW and show the message that a certain file does not have records? How to send a job forcefully into MSGW using SNDPGMMSG or SNDUSRMSG?

Software/Hardware used:
as400
ASKED: September 16, 2013  7:49 PM
UPDATED: September 18, 2013  8:35 AM

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
  • CharlieBrowne

    Who should be receiving the message?

    QSYSOPR, Submitter, other individual?

    Is it only notification, or can they retry, Ignore, or cancel?

    39,875 pointsBadges:
    report
  • TNKR
    Hi Charlie 

    I need it exactly how it happens when system error comes, an Escape message is issued and job goes into MSGW, QSYSOPR should receive the message.


    130 pointsBadges:
    report
  • TomLiotta
    What is your programming environment? What language are you programming in? Different languages have different code. -- Tom
    125,585 pointsBadges:
    report
  • MDratwa
    If this is a CL program, use RTVMBRD on the file and look at NBRCURRCD field.  If it is zero, send a inquiry message to Qsysopr or workstation and handle the response to go to exit or other routine. 
    785 pointsBadges:
    report
  • TomLiotta

    In general, use one of the 'send message' functions with a message type of '*INQ'. Send the message to '*SYSOPR' or MSGQ(QSYSOPR) or whatever destination is allowed by the function that gets to the QSYSOPR message queue.

    If we don't know the programming language environment, we on't know how the coding should be done.

    Technically, all common programming languages (including REXX) can call the Send Nonprogram Message (QMHSNDM) API, so that might be where you should look for documentation. That's about all we can say without more info.

    Tom

    125,585 pointsBadges:
    report
  • TNKR
    I wanted this logic in CL program. I have an error which is not system error, some logical error which is related to functionality, I prepared a MSG about error in my HLL program(COBOL or RPG). Then go back to CL program and now with that message shown, the job should go into MSGW.
    130 pointsBadges:
    report
  • TomLiotta
    In CL. you can use SNDMSG, SNDUSRMSG or SNDPGMMSG commands or call the QMHSNDM API. The choice depends on exact requirements. -- 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