
Community Archive (Customer) asked a question.
File size =0
Hi
Is is possible to setup a job to transfer 3 files "TBAL.txt&OPN.txt&TRN.txt" but if one of the files is 0 bytes in size transfer no files or do I have to create 3 single jobs
Regards
Dave
also assuming you have an enterprise license, you can do it a couple of ways with vbscripts.
write a script that sets a parameter:
MISetTaskParam "ZeroByteFound", "1"
inside a file loop, put an If statement, so that script runs on each file *IF* file size = zero.
then put your destination in another If statement, so it only runs *IF* [parm:zerobyteFound] != 1.
<img width="367" height="132" style="border: 0px currentColor;" alt="zerobytefound.JPG" src="/download/.attachments/zerobytefoundjpg~1"/>
or, if it's *always* going to be exactly three files, you could put the special filter 'file size > 0' on your source, then have a script count the files as they are downloaded:
Dim count<br unsafe.abp="887"/>
count = MIGetTaskParam("FileCount")<br unsafe.abp="888"/>
if count = "" then<br unsafe.abp="889"/>
MISetTaskParam "FileCount", 1<br unsafe.abp="890"/>
else<br unsafe.abp="891"/>
MISetTaskParam "FileCount", count + 1<br unsafe.abp="892"/>
end if
and again put your destination inside another If block so it only transfers the files *if* [parm:filecount] equals 3.
<img width="369" height="120" style="border: 0px currentColor;" alt="zerobytesample.JPG" src="/download/.attachments/zerobytesamplejpg" unsafe.abp="1148"/>
one thing about using these scripts: the tasks will log a "success" instead of a "no xfers" even when no files are transferred, so you need to be more careful if you're sending emails or doing other things based on success/failure.
Will send you an email with the details
Cheers
Thanks for the ideas but may have to run 3 tasks, and use our 3rd party scheduling tool to deal with the task out codes and so not pass conditions to the next job which processes the files in the backend system if 1 of the files is zero bytes
if you want, I can write you a directory parsing script that will manage this in one go.
cheers
Richard