How do I find whether a command executed by command line or by a program
0 pts.
0
Q:
How do I find whether a command executed by command line or by a program
RPG
My problem is restricting a command usage in command line but not in programs. I am going to handle it in commands validity checker program.
ASKED: Oct 13 2004  10:29 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
8025 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
When you compile your command you can specify :
CRTCMD CMD(xxxx) ALLOW(*INTERACT)
by default this parameter is set to *ALL

I think that is easier than your validity checker, even if it was not a bad idea.

=============================================================

About the only way I can think of to determine if it's in a compiled program would be to resolve and process the call stack to see if the previous call stack entries indicated a compiled program that you could recognize.

In any case, a validity checker is an inappropriate way to handle this. That's not what they are designed to do and would add a troublesome level of complexity to the execution. I can't see how it could avoid putting a significant performance drag on the process.

The ALLOW() attribute of the command is designed to control how a command may be used. That's the appropriate method.

Tom
Last Answered: Oct 18 2009  10:56 AM GMT by TomLiotta   8025 pts.
Latest Contributors: Guillet   0 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

sanderson   0 pts.  |   Oct 14 2004  9:51AM GMT

To restrict the command usage to just running from a program, you would code the ALLOW parm to be *IPGM *BPGM. If you have any batch streams that you run, you would also need to code the *BATCH value for the parm.

Hope this helps!

 
0