BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mirisage
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
shivas
Pyrite | Level 9

Hi,

Try this..

data current;

set tt;

if status_12 ='  CURRENT';

run;

Thanks,

Shiva

View solution in original post

4 REPLIES 4
shivas
Pyrite | Level 9

Hi,

Try this..

data current;

set tt;

if status_12 ='  CURRENT';

run;

Thanks,

Shiva

Mirisage
Obsidian | Level 7

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

Tom
Super User Tom
Super User

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.

Mirisage
Obsidian | Level 7

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 849 views
  • 3 likes
  • 3 in conversation