Skip to content

Custom Commands

Robin Rodricks edited this page Jun 14, 2023 · 12 revisions

API

Tip: For detailed documentation refer to the IntelliSense tips that appear when you call a given API method.

  • Execute() - Execute a custom or unsupported command that answers on the control connection. This will consist of the main response line with error or success indication and possibly further lines belonging to this response.

  • ExecuteDownloadText() - Execute a custom or unsupported command that answers on the control connection to indicate either failure or commencement of data transfer followed by success or failure, and collects the output of the command from the data connection.

How do I execute a custom command?

Use this code:

var reply = client.Execute("XCRC myfile.mp4");
if (reply.Success){
    Console.WriteLine("Code: " + reply.Code);
    Console.WriteLine("Message: " + reply.message);
}

How do I execute a custom command which returns a output on the data connection?

Use this code:

var reply = client.ExecuteDownloadText("LIST JOB00044");
if (reply != null){
    Console.WriteLine("Got lines: " + reply.Count);
}

Sample output of executing a custom command to get JCL job output on IBM z/OS systems:

image

Clone this wiki locally