03-20-2013 04:28 PM
I wanna create a file based on data in a SAS table, using the File Writer transform in DI Studio.
The generated code contains logic to enclose every variable in "-characters (qoutes). This is not what I want. Is there any way to remove these quotes?
The part of the code that is responsible for this looks something like this: (it is the quote variable that is responsilbe for this printing of quotes)
file "&FILENAME_CATO_AGG." TERMSTR=CRLF dlm=' ';
quote +(-1) ReportDate +(-1) quote
quote +(-1) FolderName +(-1) quote
03-20-2013 05:11 PM
"quote +(-1)" and "+(-1) quote" surrounding each of your variables that appear in the PUT statement. The +(-1) parts are there to snuggle the quotes against the values.
03-20-2013 06:10 PM
Well, my question wasn't really how to change the code to do what I want, but instead how to make DI Studio generate code that does what I want....
I can certainly change the code, but that would mean that I would not use the File Writer transform of DI Studio anymore, which is something that I want to continue (if possible) to do. If I instead write the code directly I get into lots of maintainability issues in our system, which is primarily built using DI Studio.
So, to restate the question more clearly: Can I make DI Studio generate code that does not put quotations around everything that is written to the file?
05-26-2014 06:12 AM
You must select "Treat consecutive delimiters as a single delimiter" in the external file properties (File Parameters tab) to prevent the double quotation marks from being included in the data.
06-12-2017 06:55 AM
This only works if you know your dataset doesn't have empty columns; if it does, then setting that option makes things worse, as the incoming data aren't read properly. unless, i suppose, we have separate metadata for the file being written an the file being output?