Write messages from RPGLE program to job spool file

210 pts.
Tags:
AS/400
RPGLE
Spool File
Hello All,
I have to perform a task. I have to write messages from RPGLE program to the job spool file of the same program. I am using QMHSNDPM api to send message to the same call stack message queue. The messages are getting written in joblog but not in spool file generated for job. I am not changing any job description parameter. Every thing is default. Though the call PGM command is there in the spool file but *info message are not getting written.
No idea why is it happening. Please help on this issue. I think that whatever is there in job log goes to spool file for printing. but this is not happening in my case.
Any help is appericiated.
Thanks
0

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.

Discuss This Question: 3  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.
  • ToddN2000
    Sounds like you want system messages to print in you production report, is this correct? If so, why not just use the joblog if they are being recorded there?
    135,305 pointsBadges:
    report
  • Yorkshireman
    Do you intend to write messages to the JOBLOG, or to the output report being created by your function?  

    If to the joblog, then you may want to look at the stack entry you are referencing, relative to the point in your function that the message is being sent from.  If you write to, say *PRV level then you are writing to the program Q that called your program.  If you write to the current level from, say , a message sending function Called from your function, then it goes to the log of the called function. 

    There are some good discussions around this are on the Midrange RPG list and elsewhere, and a read of the manuals would help understand the issues
    6,085 pointsBadges:
    report
  • TheRealRaven
    "Programs" don't have spooled joblogs; jobs have spooled joblogs. Programs have program message queues while they're running. Many messages from program message queues get transferred to the spooled joblog when the program ends.

    We need to see the code that sends the messages.

    There are a couple methods of sending messages so that they only show up in the job's external joblog, but we'd need to know what the purpose of the messages is. Also, are interested in batch or interactive jobs?
    36,340 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.

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

Following

Share this item with your network: