Using CL Commands

20 pts.
Tags:
AS/400 objects
CL Commands
RPG/400
Hi, How run the cl commands using rpg/400? how to use the chkobj command in rpg program? (That mean without using command line from wrkmbrpdm?

Software/Hardware used:
software programming
ASKED: September 20, 2011  10:27 AM
UPDATED: March 31, 2012  3:55 PM

Answer Wiki

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

From within an RPG program, you use CALL QCMDEXEC to run anything you could do from a command line.
I sugggest you do a little research in the IBM manuals and code a simple program.
If at that point you are having technical problems, please ask for assistance at that time. We are here and willing to help with technical issues.

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
  • TomLiotta
    There are multiple possible answers depending on your intended purpose. One answer is simply not to use CL for things like CHKOBJ. If you want to check if an object exists, call the Retrieve Object Description (QUSROBJD) API instead of calling another API to execute a command. Or if you want to check authorities to an object, call the Check User Authority to an Object (QSYCUSRA) API. Or don't put CL into RPG -- put it into a CL module and bind it for a procedure. Compile it rather than calling an API to interpret it. The CL compiler already does a lot of work for you. Why write RPG code to construct a command in a string out of multiple variables, pass it to an API and then handle whatever results it might log in the job? That's all easier to do in a module that's written in the appropriate language. If there is some reason to interpret and run a CL command, you can call the Process Commands (QCAPCMD) API, the Execute Command (QCMDEXC) API, the system() Execute a Command C library function and one or two others. Tom
    125,585 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