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

Hello,

 

i have a sas code writen by somebody. i don't understand what the select 100 mean in this statement. can somebody tell me what this means. thank you.

/**core medical services**/

proc sql;

create table t&year as

select providerstateid as stateid, b.* from

 

x&year a

left join

 

y&year b

on a.prid=b.prid

;

create table c as

select distinct st format=ST.,

count(distinct id) as total_clients from x&year group by st

union

select 100 as st, count(distinct id) as total_clients from x&year

order by stateid;

quit;

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarkDawson
SAS Employee
"Select 100 as st,..." creates a numeric column called "st" with a value of 100 - in a data step it would be st = 100 ; Basically it's just creating a a constant value

View solution in original post

4 REPLIES 4
MarkDawson
SAS Employee
"Select 100 as st,..." creates a numeric column called "st" with a value of 100 - in a data step it would be st = 100 ; Basically it's just creating a a constant value
juliajulia
Obsidian | Level 7
thanks both of you!
FreelanceReinh
Jade | Level 19

Hello @juliajulia,

 

Just to add to the preceding replies: Take a look at the definition of the numeric format ST.. One would expect that it assigns a label (such as 'Overall total') to the value 100 so that the summary row added by means of the UNION operator can be recognized as such.

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
  • 4 replies
  • 1239 views
  • 0 likes
  • 4 in conversation