What is the acceptable syntax to pass command from dSeries CLI utility? What is syntax if the CLI is being used in a UNIX / WINDOWS job type?

Document ID : KB000014102
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

When running DE CLI utility from command line, the OS may interfere/limit with the syntax of the command.

Question:

What is the acceptable syntax to pass command from dSeries CLI utility?  

What is the syntax if the CLI is being used in a UNIX / WINDOWS job type?

Environment:
Linux/UNIXWindows
Answer:

In Linux, the quotes have to be specified in the following manner:

cli de.example.com 7500 user1 password 'SUSPEND EVENT("USER1.MY_NEW_APP")'

The CLI command requires four parameters hostname, port, user and password and an optional fifth.  If the fifth parameter or command has multiple parts like example above, then entire command must be within single quotes.  This parameter in whole will then be passed to the server after the CLI successfully authenticates.  

The quotes are needed because parenthesis denote sub-shell in Linux and Unixes.  Hence, the command without quote will result in an error.  The following will also work, since the command has only one part in it.

cli de.example.com 7500 user1 password about

 

In Windows OS, the single quotes are not needed.  In fact, single quotes will return an error in Windows.

C:\Program Files\CA\WACLISP1\bin>cli.bat de.example.com 7500 user1 password 'SUSPEND EVENT("USER1.MY_NEW_APP")'

Parse error: Illegal start of identifier "'"

'SUSPEND EVENT("USER1.MY_NEW_APP")'

 

Additional Information:

You can define the CLI commands as a DE job in UNIX and Windows job type.  Define them exactly as they would be on the OS CLI.  If the OS requires quotes, then put quotes or leave them if not needed as in Windows. 

 cli_job.png