Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Messages in batch programm

724 views
Skip to first unread message

s...@my-dejanews.com

unread,
Jun 3, 1998, 3:00:00 AM6/3/98
to

I create a batch RPG programm. As the result of this programm i'd like have
something like LOG with all messages that happen at the processing time.
I suppose that it is a general task for a batch jobs. What is a general
decision for this situation?

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading

Steve

unread,
Jun 3, 1998, 3:00:00 AM6/3/98
to

I use the following CLP commands to send messages during batch processing.
Here are 2 examples.
The first send a message to the QSYSOPR Q, (you can change it to any Q you
like).
The second displays a message on screen, (interactive, you can use it to
monitor startup procedures etc.).
You can also use these message commands to force the user to give your
procedure a reply or input.

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

tho...@inorbit.com

unread,
Jun 4, 1998, 3:00:00 AM6/4/98
to

Sva:

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>,

s...@my-dejanews.com

unread,
Jun 4, 1998, 3:00:00 AM6/4/98
to

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.
> 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.
Ok. In my program I also have my own messages and a user messages from other
programs. I'd like to have this messages in the log file. How can I put this
messages in the joblog? Is it a good decision to put system and user messages
in the same log?

tho...@inorbit.com

unread,
Jun 5, 1998, 3:00:00 AM6/5/98
to

Sva:

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 ]

s...@my-dejanews.com

unread,
Jun 5, 1998, 3:00:00 AM6/5/98
to

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

0 new messages