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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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