on 04-08-2016 6:27 AM
Hi BODS Gurus,
I am very new to BODS area. Right now we are using BODS to extract data from HANA Calculation views and generated flat files.
One of the client requirement is to restrict the file generation, if there is no data. But now the BODS is by default generating a file with a header and 0 rows. Please help to get any setting to be maintained for this requirement.
Thank you.
Regards,
Mohan.
Hi Mohan,
If you are generating flat files at the target, irrespective of the fact whether any data is populated or not, the files will be populated at the target. For the files that does not have any data would populate 0 byte files.
There are two processes that can be followed and depends on how you implement:
One, you can check the file size by implementing get_file_attributes() function
i.e.
get_file_ attibute(/<file_location>/<file_name>,'size')
which will output 0 bytes if no data is generated within the file. You can flag the files based on this output.Then you can use the exec() command to delete the files that are 0 byte files.
Two, you can populate the files in an intermediate folder/directory and then move those files based on the count of the rows in a file. If you find zero rows then don't move the files else move the files to the desired destination folder/directory.
You can use sample from this post for implementing the move from one folder to another:
http://scn.sap.com/thread/3888373
Thanks,
AJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use conditionals to prevent the data flows from running when there are no records.
You can use the total_rows built-in function in the condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.