Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This command is used to execute an IBM i CL command. 

Parameters

  1. Command - A string containing a CL command to execute.

Exception Handling

An Error instance will be thrown with the following properties:

  • message - The IBM i message text.

  • error - The message id.

  • help - The message help text.

RPG Equivalent 

QCMDEXC System API

Examples

Check for existence of an object
var command = "CHKOBJ OBJ(QTEMP/WORKFILE) OBJTYPE(*FILE)";
var exists = true;
try {
  pjs.runCommand(command);
}
catch(e) {
  exists = false;
}

Create a duplicate file in QTEMP
var command = "CRTDUPOBJ OBJ(ORDERSP) FROMLIB(DATALIB) OBJTYPE(*FILE) TOLIB(QTEMP) NEWOBJ(WORKFILE) DATA(*NO)";
pjs.runCommand(command);

Requirements

This API requires the Profound.js Connector module.

  • No labels