Execute CL commands within an ILE RPG program

Execute CL commands within an ILE RPG program

To execute the CL commands from an ILE RPG program, use a prototype to call the QCMDEXC program. This program requires two parameters. The first parameter is of type Character, and this will be the command you wish to execute. The second parameter will be of length 15 with 5 decimal places. By using the %Size function you do not need to hard code the command length.


 ** The below prototype is used call the QCMDEXC system program     
DQCmdExc          PR                  ExtPgm('QCMDEXC')             
D Cmd                         1024A   Options(*Varsize) Const       
D CmdLen                        15P 5 Const                         

In your 'C' specs:

CallP     QCmdExc('' :  %size('command string'))

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts including news, tips, and advice to help you do your job more efficiently and effectively. Stay informed on the hottest topics and biggest challenges faced by IT professionals working with iSeries products and services.

    By submitting your registration information to Search400.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of Search400.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

This was first published in June 2001

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.