dbTalk Databases Forums  

DTS getting to next task before finishing the first

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS getting to next task before finishing the first in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
Nitin
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 08:35 AM






Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:

Quote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo



Reply With Quote
  #42  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM






On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #43  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM



On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #44  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM



On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #45  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM



On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #46  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM



On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #47  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM



On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #48  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM



On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #49  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:01 AM



On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo
OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know



Reply With Quote
  #50  
Old   
matteus
 
Posts: n/a

Default Re: DTS getting to next task before finishing the first - 06-19-2008 , 10:07 AM



On 19 Giu, 17:01, matteus <matteog... (AT) gmail (DOT) com> wrote:
Quote:
On 19 Giu, 15:35, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:



Hi Matteus..
Thanks a lot..this is exactly what my requirement is..but the solution you
gave me,I am not able to understand should i write the entire thing in a
activeX task in dts or create a Batch file and execute from Active X or
should i write these lines in the same activeX where I am using FTP
commands..I just want to go to the next step after finishing this FTP process
the next step is also an ActiveX task...
Thanks
Nitin

"matteus" wrote:
On Jun 18, 7:54 pm, Nitin <Ni... (AT) discussions (DOT) microsoft.com> wrote:
Hey somebody pls come up with some ideas.....

"Nitin" wrote:
I have ONSUCCESS precedence on all the tasks...logically the second one shud
execute only when the first is success..but bcus the first tsk is having the
FTP commands and there are some number of them, so before finishing those FTP
commands it declares the ActiveX successful and jumps to the next step..where
as on the command prompt it still shows the FTp doing its work.

"Chris" wrote:

What precedent constraints do you have between the steps. If no contraints
exist then there is potential that both steps will run at the same time.

-Chris

"Nitin" wrote:

I have a DTS Package where there are 4 tasks all connected to each other with
OnSuccess flow , the first task is collecting all the files from FTP
and dumping in a STAGING area and then those files from STAGING area are
taken and processed with the next 3 remaining tasks.
Individually all the task is working fine, but when I run the entire package
the first task where it is taking the files from FTP location is taking time
but
it is declared success and goes to the next step, although the FTP process
is still running and has not finished dumping the files to staging area,
so on the next step it is not getting the files from the concerned location
as the FTP is not finished. Please let me know how to make sure that once
this FTP part
is over then only it shuld go to the next step

Hi Nitin
i had a problem like yours. It seems as the task that runs the ftp.exe
ends up with success even if the ftp.exe process has not yet finished.
Is this your problem? If yes, this is a correct behaviour because
ftp.exe (or whatever prg you use to get files) is external to DTS
environment. So you should use a batch file that sends and errorcode
to the dts control flow.
Try to adapt this one, for me it worls very well.

FTP -s:%1 > %2
Type %2 >> yourlogfile.log
If Exist %2 Type %2 | Find "221 " > Nul
If Exist %2 If not errorlevel 1 If not errorlevel 2 goto 221_ok
exit 1
:221_ok
Type %2 | Find "226 " > Nul
If not errorlevel 1 If not errorlevel 2 goto 226_ok
exit 1
:226_ok
Type %2 | Find "530 " > Nul
If errorlevel 1 If not errorlevel 2 goto 530_ok
exit 1
:530_ok
Type %2 | Find "550 " > Nul
If errorlevel 1 If not errorlevel 2 goto 550_ok
exit 1
:550_ok
exit 0

it checks for a 226 ftp errorcode that means success

%1 is the commandfile, which is built dinamically (server, user,
password and the file name) with ActiveX Script task. %2 is the log
file that this batch checks for various ftp.exe errorcodes.
I have to send a file that changes every time (this process runs every
30 minutes on my server) but i believe you could easily use it also
for getting files.

Please let us know
Bye, Matteo

OK the code i've posted should be put in a batch file, let's say
SendFTP.BAT. The content is static, that remains always the same.
What you should do in your package is launch it through a new Execute
Process task, and link the rest of your package with a OnSuccess
constraint from this EPtask to your next ActiveX Task. And again you
could also add a OnFailure constraint to... whatever you want to
happen if the send ftp task fails.
The EP task should contain these parameters:
win32 Prrocess: \\yourserver\yourpath\SendFTP.bat
Parameters: \\yourserver\yourpath\yourFTPcommandfile \\\\yourserver
\yourpath\yourFTPlogfile
Return Code: 0

I know you must get a file but try a send if you can before and let us
know

For an explanation of FTP error codes take a look here:
http://www.networksorcery.com/enp/protocol/ftp.htm

M.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.