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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 710 views
  • 0 likes
  • 2 in conversation