Hi Community,
I have run the proc freq for the attahced file and it produces output.
proc freq data=tt;
tables status_12;
run;
Question
When I tried the below subsetting, log says
NOTE: No rows were selected. And subsetted table is not created.
How come this happen? Could anyone please let me know.
data current;
set tt;
if status_12 ='CURRENT';
run;
proc sql;
select status_12
from tt
where status_12 = 'CURRENT';
quit;
Thanks
Mirisage
Hi,
Try this..
data current;
set tt;
if status_12 =' CURRENT';
run;
Thanks,
Shiva
Hi,
Try this..
data current;
set tt;
if status_12 =' CURRENT';
run;
Thanks,
Shiva
Hi Shiva,
Yes, it worked. Thanks a lot.
Could you please let me know how your code worked while my same code not worked.
How did you decide to leave two spaces in front of ' CURRENT';
Please let me know. Thanks
Here is one way to see what is really in your character data.
data _null_;
set x.tt;
put (_character_) (= $quote. /) /;
run;
Output on the LOG:
STATUS_12=" CURRENT"
STATUS_11=" CURRENT"
STATUS_10=" CURRENT"
STATUS_9=" CURRENT"
STATUS_8=" CURRENT"
STATUS_7=" CURRENT"
STATUS_6=" CURRENT"
STATUS_5=" CURRENT"
STATUS_4=" CURRENT"
STATUS_3=" CURRENT"
STATUS_2=" CURRENT"
STATUS_1=" CURRENT"
STATUS_0=" CURRENT"
STATUS_12=" CURRENT"
STATUS_11=" CURRENT"
STATUS_10=" CURRENT"
STATUS_9=" CURRENT"
STATUS_8=" CURRENT"
STATUS_7=" CURRENT"
STATUS_6=" CURRENT"
STATUS_5=" CURRENT"
STATUS_4=" CURRENT"
STATUS_3=" CURRENT"
STATUS_2=" CURRENT"
STATUS_1=" CURRENT"
STATUS_0=" CURRENT"
STATUS_12=" CURRENT"
STATUS_11=" CURRENT"
STATUS_10=" CURRENT"
STATUS_9=" CURRENT"
STATUS_8=" CURRENT"
STATUS_7=" CURRENT"
STATUS_6=" CURRENT"
STATUS_5=" CURRENT"
STATUS_4=" CURRENT"
STATUS_3=" CURRENT"
STATUS_2=" CURRENT"
STATUS_1=" CURRENT"
STATUS_0=" CURRENT"
STATUS_12=" CURRENT"
STATUS_11=" CURRENT"
STATUS_10=" CURRENT"
STATUS_9=" CURRENT"
STATUS_8=" CURRENT"
STATUS_7=" CURRENT"
STATUS_6=" CURRENT"
STATUS_5=" CURRENT"
STATUS_4=" CURRENT"
STATUS_3=" CURRENT"
STATUS_2=" CURRENT"
STATUS_1=" CURRENT"
STATUS_0=" CURRENT"
STATUS_12=" CURRENT"
STATUS_11=" CURRENT"
STATUS_10=" CURRENT"
STATUS_9=" CURRENT"
STATUS_8=" CURRENT"
STATUS_7=" CURRENT"
STATUS_6=" CURRENT"
STATUS_5=" CURRENT"
STATUS_4=" CURRENT"
STATUS_3=" CURRENT"
STATUS_2=" CURRENT"
STATUS_1=" CURRENT"
STATUS_0=" CURRENT"
NOTE: There were 5 observations read from the data set X.TT.
Hi Tom,
This is exactly what I wanted to know in my second "question".
Now I know how the 2 spaces were decided in " CURRENT"
Thank you very much. I wanted to "click" "correct answer", but there was no such option left for me to "click".
Regards
Mirisage
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.