Hi Gurus
I am generating a CSV file from within a job with sequential file stage.However , whenever there is no data at the source side , it is generating a blank CSV file. Is there any way I can prevent this or any workaround .
Not able to prevent generation of empty CSV file
Moderators: chulett, rschirm, roy
Re: Not able to prevent generation of empty CSV file
Isn't it supposed to??kasgang wrote: I am generating a CSV file from within a job with sequential file stage.However , whenever there is no data at the source side , it is generating a blank CSV file.
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Why would you want to prevent this?kasgang wrote: Is there any way I can prevent this or any workaround .
gateleys
Hi,
By definition an empty fie should contain nothing if it is really empty
This is done as part of the overwrite operation on the previos file.
You can try to delete any existing file, then only run the job if there are rows to process.
Or you can delete the file after verifying no rows were written to it.
IHTH,
By definition an empty fie should contain nothing if it is really empty
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
This is done as part of the overwrite operation on the previos file.
You can try to delete any existing file, then only run the job if there are rows to process.
Or you can delete the file after verifying no rows were written to it.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Or it could contain a single header record. That's why, IMHO, you should check the LinkRowCount and not the file size as that will 'always' work for you.roy wrote:By definition an empty fie should contain nothing if it is really empty![]()
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
OK I ment DATA wise Craig, probably that exclamation mark was uncalled for ![Wink :wink:](./images/smilies/icon_wink.gif)
Craig if you were refering to a file header record that contains some general and or validation data like the number of rows that the file should contain then that is also data.
Obviously the way to determine number of rows is subject to the process logic and should reflect a proper method to reflect existance of or lack of rows![Smile :)](./images/smilies/icon_smile.gif)
![Wink :wink:](./images/smilies/icon_wink.gif)
Craig if you were refering to a file header record that contains some general and or validation data like the number of rows that the file should contain then that is also data.
Obviously the way to determine number of rows is subject to the process logic and should reflect a proper method to reflect existance of or lack of rows
![Smile :)](./images/smilies/icon_smile.gif)
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Hi Gurus
Thanks for the inputs. By empty files I meant , file with header rows only . The way I am doing it now , is checking the LinkRowCount and writing to another file the filenames with LinkRowCount=0.
Then I am deleting the empty CSV files referring to this file.
Just wanted to know if there is anythig better that way to do the same.
Thanks for the inputs. By empty files I meant , file with header rows only . The way I am doing it now , is checking the LinkRowCount and writing to another file the filenames with LinkRowCount=0.
Then I am deleting the empty CSV files referring to this file.
Just wanted to know if there is anythig better that way to do the same.
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
use folder stage
Make use of Folder stage as the target stage instead of the sequential file stage and your requirement will be achieved easily. we have done the same things successfully.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0