× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



John McKee wrote:
I had wanted to log when files were retrieved via
sFTP on QSYSOPR. As a visual noted that specific
files were retrieved and processed. I was going to
do that from within my QSH script. But, things are
not quite that easy.

I am curious if anybody would know or be willing
to speculate as to why SNDMSG is allowed in
different environments from SNDPGMMSG. We are on
v5r4. I do not know if the commands have been
modified, either by our application package
(doubtful, as they usually create their own
commands), or by the sys admin.

On this system, SNDMSG is available for:

*IMOD *BMOD *IREXX
*BREXX *BPGM *IPGM
*EXEC *INTERACT *BATCH

And SNDPGMMSG is available for:

*IREXX *BREXX *BPGM *IPGM

Any thoughts?

SNDPGMMSG intends to send messages primarily to program message queues; really for use in compiled programs, but CL extensions to REXX will allow its use there as well, even though interpreted.

For why there is this environment limitation, IMO it is most obvious in review of a command which functions almost exclusively with return values [via variables]. For example the RTVJOBA command is not allowed in *INTERACT because all of its parameters return results into variables; i.e. if RTVJOBA USER(&U), then we need to have declared the variable &U, into which the 10-byte character replacement value would be placed. That requires declared variable to be available in the environment in which the command invocation is made. Running in a program, the variables can be declared; e.g. DCL &U *CHAR LEN(10). Since at a command line there are no variables, invoking the command is disallowed. Note that comment does not intent to imply there could not be variables, just that there are not; i.e. QCMD could as an environment, store variables & their values, such that after an invocation it could also allow viewing the changed values.
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/cl/rtvjoba.htm

The SNDPGMMSG has similar parameter(s) which also function only with variables, for return values as feedback to the program, for its SNDPGMMSG request. See KEYVAR() for example. Thus its restriction to be run only in REXX and compiled PGM where variables are available.
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/cl/sndpgmmsg.htm

SNDMSG is a tool for sending messages to user and workstation message queues, not to program message queues, so it is not limited in where it can be run.
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/cl/sndmsg.htm

Other commands will have different environment limitations. Another likely to be encountered case, is a command not being allowed in a batch environment. That happens when the program processing the command requires being able to output to the workstation of the user; i.e. uses the display file of the requester. Other commands will be limited only to batch because they intend only to implement batch stream processing; e.g. the DATA command which identifies data in the stream as file data.
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/cl/data.htm

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.