Execute a CMD command with -CLI option

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
Alex_sp
Participant
Posts: 11
Joined: Fri Aug 25, 2006 4:38 am
Location: Madrid-Spain

Execute a CMD command with -CLI option

Post by Alex_sp »

Hi to all,
I've to execute a dynamic command (CMD) like "mk XXXX" where XXXX takes different values.
I'm using a batch File adapter as target, but I don't know how to code it.
How I can execute a dynamic command? wiht -CLI?
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

You could use the batch adapter calling a batch file with a parameter
eg

=valid(PUT("BAT","-cmd ""ftpcmd.bat " + filename"" -P 30:10 -tv -I"," "),fail("run ftp failed " + TEXT ( LASTERRORCODE ( ) ) + " " + LASTERRORMSG()))

where filename was the parameter to the batch file. So you could have mk %1.
jgibby
Participant
Posts: 42
Joined: Thu Dec 16, 2004 8:48 am

Post by jgibby »

To me the documentation on the Batch/Shell adapter was totally confusing. Finally I hit on the following that works (so far) for all our needs:

Code: Select all

=GET("SHL","-cli -cmd 'mkdir " + DirName + "'")
Hope it helps,
John
"Artificial intelligience is no match for natural stupidity."
Post Reply