How to write a CL program to place RUNQRY in the application menu

45 pts.
Tags:
CL
CL Program
RUNQRY
My management has asked me to disable the ability of users to access command line from an application by limiting capabilities *YES. I need to write a CL that will allow me to place RUNQRY into the application menu and need help creating the CL program. Can anyone assist?

Answer Wiki

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

You would need to create a display file — Lets say its named DSPRUNQDF
with a record DSPRUNQR
which would show the options and have an input capable field say SLFLD
In the CL this field would be used as &SLFLD

The CL Pgm

Pgm
DCLF DSPRUNQDF
SNDRCVF DEV(*FILE) RCDFMT(DSPRUNQR)
if (&SLFLD = ‘1’) then RUNQRY VERYFIRSTQ
if (&SLFLD = ‘2’) then RUNQRY Qry2

Endpgm

The dspf – DSPRUNQDF

R DSPRUNQR
10 21′ 1 – Run Query 1′
11 21 ‘2 – Run Query 2′
12 10 ‘Selection’
SLFLD 1 12 21

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

Actually, if all you need is a CL program that executes RUNQRY, then here’s the entire program:<pre>
?RUNQRY</pre>
That will handle every query your users will ever need.

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
  • Gilly400
    Hi, If you just need to run a query you can do something like this :- PGM RUNQRY YOURQRY ENDPGM Or do you need help getting started with CL programs? If that's the case, then try This link. Regards, Martin Gilbert.
    23,730 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