BookmarkSubscribeRSS Feed
mjack
Calcite | Level 5

Hi Experts,

Using proc freq,   how can I achieve the results achieved by the following queries :

proc sql;

     select count(distinct(columnname))  from datasetname where columnname > 6   and columnname < 100;

quit;

proc sql;

     select columnname, count(*) from datasetname where columnname > 6   and columnname < 100;

quit;

Because when I run above sqls I get   'ERROR: SPDS Sql Passthru Error.'

Pls help...

1 REPLY 1
ballardw
Super User

The proc freq equivalent woud be

proc freq data=datasetname;

     where 6 < columnname < 100;

     tables columname/ nopercent;

run;

but your problem may be related to the DB connection.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1 reply
  • 690 views
  • 0 likes
  • 2 in conversation