Obtaining and interpreting DS CLI exit codes

Complete this task to obtain and interpret DS CLI exit codes.

Whenever you complete a transaction using the DS CLI single-shot mode or the script mode, an exit code is generated. However, no exit codes are generated when you use the DS CLI interactive mode, because you never leave the DS CLI session.

When you use the single-shot mode, an exit code is generated after each DS CLI command is fully processed. When you use the script mode, exit codes are only generated when the script exits the session. In script mode, you must interpret output for the status.

DS CLI exit codes provide more general reasons (than the error messages provide) why a CLI command transaction has failed. The following table lists the exit codes and their meanings.
Note: Only the code number is displayed when you are using the single-shot or script mode not the code description.
Code Category Description
0 Success Specifies that the command is successfully processed
2 Syntax Error Specifies that there is an error in the way that the command is presented (misaligned or wrong parameters) for processing
3 Connection Error Specifies that there is a connectivity or protocol error
4 Server Error Specifies that an error occurs during a function call to the application server
5 Authentication Error Specifies that an error occurs during the authentication process
6 Application Error Specifies that an error occurs due to a MetaProvider client application specific process

Perform the following steps to obtain, interpret and use the DS CLI exit codes.

  1. (Script mode) Retrieve the most recent exit code. For a Windows operating system, use “%ERRORLEVEL%” to retrieve the most recent exit code. For a UNIX or Linux operating system, use “$?” to retrieve the most recent exit code.

    The following examples demonstrate the retrieval commands. The first part of the example shows the command that failed and the second part of the example shows the code to obtain the DS CLI exit code.

    Windows operating system

    C:\Program Files\ess\cli>dscli test
    CMMCI9013E Command: test was not found.
    Tip: Enter “help” for a list of available commands.
    C:\Program Files\ess\cli>echo %ERRORLEVEL%
    2

    UNIX or Linux operating system

    aix23 ->dscli test
     CMMCI9013E Command: test was not found.
    Tip: Enter “help” for a list of available commands.
    echo $?
    2
  2. Use the previous table to interpret the value that is associated with the code and correct the command according to the exit code description.

Processing that determines your next course of action

Based on the interpretation of the exit code value and the following processing description that is associated with a failed DS CLI transaction, you can determine your next course of action.
Single-shot mode
The following processing is associated with a single-shot mode transaction:
  • All operations of the DS CLI transaction that can be processed are processed even though an error has occurred with one or more of the processed parameters that are associated with the transaction.
  • A report on all successful completions is generated.
  • A report on all failures is generated.
Script mode
The following processing is associated with a script mode transaction:
  1. A DS CLI failure exit code is issued.
  2. The script mode is automatically exited with no additional processing.
Library | Support | Terms of use | Feedback
© Copyright IBM Corporation 2004, 2007. All Rights Reserved.