How to get the script output from a command task in Informatica BDM?
If a command task is executing a shell script, you will get the exit code, standard output and standard error from the script in the Command task output. You can assign these fields to a workflow variable in the "Command Task Output" and use later in the workflow.
Let's consider a shell script which will look for an Inbound file in a source location, If the file found script will display the file name and complete with an exit code 0. You are calling this script from a command task, after the execution you will get the outputs like below in the command task.
v_cmt_01_exitcode = 0
v_cmt_01_stdout = file_name.txt
v_cmt_01_stderr =
If the script failed due to an unknown Issue
v_cmt_01_exitcode = 1
v_cmt_01_stdout =
v_cmt_01_stderr = "error message"
If the script failed due to a known Issue (Assuming Script is coded such a way to exit with code 1 and with a proper error message)
v_cmt_01_exitcode = 1
v_cmt_01_stdout = "File not found in the source location"
v_cmt_01_stderr =
If you want to display the workflow variable for debugging purpose, use a notification task and send the variables to you email for validation.
Output Data
|
Datatype
|
Description
|
---|---|---|
Exit Code
|
Integer
|
Exit code returned by the command. A successful command returns 0. An unsuccessful command returns a non-zero value.
|
Standard Error
|
String
|
Standard error message returned by the command. By default, the first 1,024 characters of the error are returned. If the calling script encounter any kind of abnormal error, You will get the error message in "standard Error"
|
Standard Output
|
String
|
Standard output returned by the command. By default, the first 1,024 characters of the output are returned. This will be output from the shell script.
|
Liked the content??
Please Like FB page & subscribe the channel!
Let's learn together!
Need Help? email me!
Search tags!
How to get the script output from a command task in Informatica BDM?
How to get the script error from a command task in Informatica BDM?
How do I run a shell script in Informatica command?
How to get the error message from Informatica BDM command task?