How do I find whether a command executed by command line or by a program

pts.
Tags:
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Sanderson
    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 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following