When installing an application using the command line, the Setup Administrator process returns one value from a set of exit codes from its process when exiting.
After an application install, when the Setup Administrator process exits, users can check the exit codes to determine the cause for a possible problem with the application install.
The set of Setup Administrator exit codes are described below:

Exit Code Name

Exit Code

Description

AdmExitedNormally

0

The user clicked the main window's X button in the top right, the Exit item from the File menu, or the task that ran completed without error.

InternalError

1

An unexpected internal error occurred. The user should contact WhereScape support and supply any relevant log files.

CommandCancelled

2

The user clicked the cancel button from one of the presented dialog boxes, thus aborting the running task.

RequiredParameterMissing

3

One or more required parameters is missing, e.g. a name for the Scheduler, an ODBC DSN, a user name, a password.

OdbcError

4

An error was reported from the RDBMS that Setup Administrator was communicating with.

FileIoError

5

A specified file or directory was unable to be opened, read from or written to.

ServiceControlManagerError

6

An error was reported from the Windows Service Control Manager. Often, this is because Setup Administrator needs to be run "As Admin" when dealing with the SCM.

OracleCompilationError

7

An Oracle stored procedure has failed to compile.

MetaDataError

8

Metadata was or was not found in the specified RDBMS, or the metadata failed to upgrade, or the metadata is corrupt, or the metadata type mismatches, i.e. trying to import an Oracle application into Teradata metadata.

ItemsCheckedOut

9

In batch mode, if you want to overwrite checked out items, you must explicitly state so by setting the option to true in the settings.

NotLicensed

10

License does not permit objects of a specific type to be imported.

Users can test for these values, using a batch file and take action accordingly.
Below is an example batch file that can be used to check Setup Administrator's exit code.

Example batch file - SQL:

@echo off
Adm.exe /AL /AF "app_con_SQLT_base_1.wst" /LF "ImportLog.txt" /PF "WSL_Application_Load_SQL.xml"

if errorlevel 8 goto MetaDataError

if errorlevel 5 goto FileIoError

if not errorlevel 0 goto ImportError

echo Successfully imported
goto end
 
:MetaDataError

sendmail -recipient admin@company.com -subject "Import failed" -body "Corrupt meta data found during application import. Re-install the Data Warehouse"

goto end
 
:FileIoError

sendmail -recipient admin@company.com -subject "Import failed" -body "ExportedDiagram.xml is missing, re-generate it then re-run this process"

goto end

:ImportError

sendmail -recipient admin@company.com -subject "Import failed" -body "Unable to import the application file ExportedDiagram.xml"

goto end

:end

Example batch file - 3D:

@echo off
Start /wait /D "C:\Program Files (x86)\WhereScape\Adm.exe" /AL /AF "ExportedDiagram.xml" /LF "C:\temp\test\ImportLog.txt"

if %errorlevel% equ 8 goto MetaDataError
if %errorlevel% equ 5 goto FileIoError
if not %errorlevel% equ 0 goto ImportError
echo Successfully imported
goto end

:MetaDataError
sendmail -recipient admin@company.com -subject "Import failed" -body
"Corrupt meta data found during application import. Re-install the Data Warehouse"
goto end

:FileIoError
sendmail -recipient admin@company.com -subject "Import failed" -body
"ExportedDiagram.xml is missing, re-generate it then re-run this process"
goto end

:ImportError
sendmail -recipient admin@company.com -subject "Import failed" -body
"Unable to import the application file ExportedDiagram.xml"
goto end

:end



  • No labels