How to creat a new fresh export file after running the bteq script. Don't want to manually delete the existing file and not willing to append the new record to the existing one.
.EXPORT report File = directory_path/XYZ.txt
this will append output record every time the script will run...I don't want this.
Thanks man..this will work..but my requirement was not to delete the entire file and just empty the file content.
I think this will be more appropriate..since I dont know whether the .EXPORT command with some option can handle this or not.
cat /dev/null > directory_path/XYZ.txt
Much appropriate way of doing this is to check the file if it exists.
-- If condition to check if the files exists; If it does then remove it.
.OS IF [ -f directlry_Path/XYX.txt]; then
.OS rm -f directory_path/XYZ.txt;
NOTE: BTEQ doesn't support multi line OS commands. This is how you would use it in bteq
.OS IF [ -f directlry_Path/XYX.txt]; then rm -f directory_path/XYZ.txt; fi;