Hello all:
I want to read some characters into SAS from a text file. One record has a value '. ' which is a period followed by a space. However, SAS read treat it as missing. My understanding is that period is treated as missing for numeric but not for character. So why this is the case and how to read a value like that as it is? For example, if this is my input file mydoc.txt:
a
.
b
You can use the $CHAR informat.
data check;
input @1 x $1. @1 y $char1.;
put x= y=;
cards;
.
run;
x= y=.
You can use the $CHAR informat.
data check;
input @1 x $1. @1 y $char1.;
put x= y=;
cards;
.
run;
x= y=.
Use $char informat:
data have;
input var$char1.;
cards;
a
.
b
;
proc print;run;
Regards,
Haikuo
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.