BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ronein
Meteorite | Level 14

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

Ronein_0-1695811235965.png

 

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Amir
PROC Star

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.

View solution in original post

2 REPLIES 2
Ronein
Meteorite | Level 14

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?

 

 

Amir
PROC Star

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.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 969 views
  • 1 like
  • 2 in conversation