Hello
I am using data step to export sas data set into txt file.
When I open the txt file via notepad I see that it looks like that
My questions-
1-Why the values are with double quotation??
2-Let's say that there are missing values (numeric and char) in the sas data set .
In such situation do you recommend replacing the missing values into null (It means that for missing numeric the value will be null instead of dot and for char value the value will be also null)?
IT can be done by
options MISSING='';
%let file_extract=/usr/local/SAS/SASUsers/LabRet/Adhoc/creditCards/RRRRRR6.txt;
%put &file_extract;
data _null_;
file "&file_extract." dsd dlm = '|';
set sashelp.cars;
put (_all_) (~);
run;
Hi,
You have answered your first question:
1-Why the values are with double quotation??
with your 2nd post:
I see, By using the DSD option, columns containing the delimiter will be quoted. What is the advantage of using DSD? MAy it happen that in column value there is same value like the delimiter and then there will be a problem to recognize the columns correctly?
I am not sure IF the users of the txt file want to see the values with double quotation....
What do you recommend me to do?
And your second question:
2-Let's say that there are missing values (numeric and char) in the sas data set .
In such situation do you recommend replacing the missing values into null (It means that for missing numeric the value will be null instead of dot and for char value the value will be also null)?
IT can be done by
options MISSING='';
has an answer from your 2nd post, viz., ask the users of the file what their requirements are when it comes to missing character (always blank) and numeric (missing option) values.
So in answer to your question in your 2nd post:
What do you recommend me to do?
contact the users of your output, and make sure they confirm their requirements in writing.
Thanks & kind regards,
Amir.
I see, By using the DSD option, columns containing the delimiter will be quoted. What is the advantage of using DSD? MAy it happen that in column value there is same value like the delimiter and then there will be a problem to recognize the columns correctly?
I am not sure IF the users of the txt file want to see the values with double quotation....
What do you recommend me to do?
Hi,
You have answered your first question:
1-Why the values are with double quotation??
with your 2nd post:
I see, By using the DSD option, columns containing the delimiter will be quoted. What is the advantage of using DSD? MAy it happen that in column value there is same value like the delimiter and then there will be a problem to recognize the columns correctly?
I am not sure IF the users of the txt file want to see the values with double quotation....
What do you recommend me to do?
And your second question:
2-Let's say that there are missing values (numeric and char) in the sas data set .
In such situation do you recommend replacing the missing values into null (It means that for missing numeric the value will be null instead of dot and for char value the value will be also null)?
IT can be done by
options MISSING='';
has an answer from your 2nd post, viz., ask the users of the file what their requirements are when it comes to missing character (always blank) and numeric (missing option) values.
So in answer to your question in your 2nd post:
What do you recommend me to do?
contact the users of your output, and make sure they confirm their requirements in writing.
Thanks & kind regards,
Amir.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.