-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
1. SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('MY +
MESSAGE STATUS - Hello world.....')+
TOPGMQ(*EXT) TOMSGQ(*SYSOPR) MSGTYPE(*INFO)
2. SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
MSGDTA('Hello world.......')+
TOPGMQ(*EXT) MSGTYPE(*STATUS)
Another option is to use the DSPLY operation in RPGLE to send/display
messages direct from an RPGLE program.
Also, you can use the CALL QCMDEXC procedure within an RPG program to call
CL commands directly.
Hope these help
Steve
s...@my-dejanews.com wrote in message <6l2sg2$9t1$1...@nnrp1.dejanews.com>...
Assuming you are asking about standard job logs, yes, it is a general task.
The system will create a joblog print file that can be reviewed later -- and
this assumes that the system was told to do this by setting the proper
parameter values for the LOG() parameter on the SBMJOB command or on the job
description used for the batch job.
Changing those values changes how much is logged and determines if the log is
printed when the batch job ends, that is, whether the log is converted into a
print file.
Tom Liotta
In article <6l2sg2$9t1$1...@nnrp1.dejanews.com>,
The choice of deliberately placing messages into a joblog is up to you.
Certainly, it is a common action. The joblog is a widely recognized facility
among AS/400 programmers, and even users, so it is a reasonable place to log
messages.
As with any log function, considerations include auditability and maintenance.
Messages in joblogs are hard to fake or alter, but keeping and managing a
large number of joblogs can get to be difficult.
An example of maintenance trouble: Because a batch (or interactive) job's
control structures remain in the system for as long as any part of the job
remains, the job exists for as long as the joblog exists. After a few thousand
joblogs are created, the system has control structures allocated for a few
thousand jobs. Many AS/400s are small enough that this can cause various kinds
of space problems. And, when the list of joblogs gets long, it can take much
more time to scroll through the list.
Depending on the requirements for the batch job, sometimes the joblog is
ideal. Other times, the messages can simply be sent to a message queue of your
choice -- I have a number of message queues that I've created just to maintain
"logs" of various kinds of events.
I'd guess that if every contributor to this newsgroup answered this question,
you'd get a different answer and justification from each. And most would
probably be correct.
In short, the answer to your last question is "yes and no".
Your first question is easy. I'll give an example in CL. With the following
statement in a CL program run in batch, the message "Sample joblog message"
would appear in the joblog:
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Sample +
joblog message') TOPGMQ(*EXT) MSGTYPE(*INFO)
There are numerous variations. A critical piece in this case is
the TOPGMQ(*EXT) parameter value. That says that the message is going to be
sent to the "external" program message queue, which for a batch job is the
joblog.
You can take that statement, compile it by itself into a CL program, submit it
to batch and check the joblog. Submit it in various ways, by changing the
LOG() parameter values on the SBMJOB or the job description; and see how it
affects the joblog.
RPG does it differently, but examples can wait until you feel comfortable with
this approach.
Tom Liotta
In article <6l5htc$2ln$1...@nnrp1.dejanews.com>,
s...@my-dejanews.com wrote:
>
> In article <6l587a$msa$1...@nnrp1.dejanews.com>,
> tho...@inorbit.com wrote:
> >
> > Sva:
> >
> > Assuming you are asking about standard job logs, yes, it is a general
task.
[ etc ]
> Your first question is easy. I'll give an example in CL. With the following
> statement in a CL program run in batch, the message "Sample joblog message"
> would appear in the joblog:
>
> SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Sample +
> joblog message') TOPGMQ(*EXT) MSGTYPE(*INFO)
>
> There are numerous variations. A critical piece in this case is
> the TOPGMQ(*EXT) parameter value. That says that the message is going to be
> sent to the "external" program message queue, which for a batch job is the
> joblog.
Thank you. It's working. I also tested it in RPG - it's OK. To send messages
i use QMHSNDPM programm with '*EXT' as a name of the call stack program
message queue.