Unlinking error while run a Dos batch file from Datastage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ArijitS
Participant
Posts: 24
Joined: Sat Jun 02, 2007 8:58 am
Location: Kolkata

Unlinking error while run a Dos batch file from Datastage

Post by ArijitS »

I want to use a batch file for moving some files to some folder to another folder.I am trying with adding batch by DosExec in Before job subroutine then it shows "Unlink" error though the command work fine from command prompt.It also gives same error while running it from routinr.
Kindly suggest how to solve the problem.

I am using: Windows 2003,IBM INFORMATION SERVER(Datastage 8.0 server job)
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Unlinking error while run a Dos batch file from Datastag

Post by sachin1 »

to implement your functionality you can use ExecDos (Before job routine) and give input values for moving a file.

ExecDos move #directory#\file1.txt #directory#\file2.txt
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Could be because you are using relative rather than absolute paths for your filenames. If you still have problems, post your syntax.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArijitS
Participant
Posts: 24
Joined: Sat Jun 02, 2007 8:58 am
Location: Kolkata

Post by ArijitS »

[quote="chulett"]Could be because you are using relative rather than absolute paths for your filenames. If you still have problems, post your syntax. ...[/quote]

cmd1="move /Y I:\TELSTRA_DATASOURCE_ETL\FLEXCAB\SRC\*.csv I:\TELSTRA_DATASOURCE_ETL\FLEXCAB\PRCSD"

Call DSExecute("NT", cmd1, op, SystemReturnCode)

i got similar problem for
cd I:\TELSTRA_DATASOURCE_ETL\FLEXCAB\SRC\
rm -r *
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

ArijitS wrote:...rm -r *
will only work on Windows if you have MKS toolkit or similar UNIX emulation installed and active. Also, it needs to be on one line separated by semicolon and doing an rm -r command after changing directories but not making sure you are in the right one is asking to find out if your last backup was successful.
Post Reply