Problem with dscmdexport.exe exit status

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

Problem with dscmdexport.exe exit status

Post by mavrick21 »

Hi,

I'm unable to capture the correct exit status of dscmdexport.exe in a Windows batch file. I searched this forum and found a lot of posts but it wasn't helpful.

Below is my code. Irrespective of failure or success ERRORLEVEL value is set to 0 and both "Success" and "Fail" lines are echoed.

Code: Select all

@echo off
echo "Export started"
C:\apps\ibm\InformationServer\Clients\Classic\dscmdexport.exe /D=<domain>:<port> /H=<Host> /U=<Usrname> /P=<password> <Project>"C:\temp\DSX_Backup.dsx"
IF NOT ERRORLEVEL 0 GOTO Fail
echo "Success"
:Fail
echo "Fail"
Can anyone please help me out with this?
Thanks for your time.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

None of the command line commands support this. Makes it difficult to trap errors.
Mamu Kim
mavrick21
Premium Member
Premium Member
Posts: 335
Joined: Sun Apr 23, 2006 11:25 pm

Post by mavrick21 »

Kim,

Please correct me if I'm wrong. Do you mean to say that dscmdexport.exe doesn't return exit value to ERRORLEVEL?

Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your success code falls through to the failure code, that's why you get both echoes when things go well. What happens if you force a failure?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I could never get ERRORLEVEL to trigger in 7.5.3 or older versions.
Mamu Kim
Post Reply