Skip to content
Advertisement

Tag: sas

Why ‘where’ statement seems to filter expected rows in SAS proc SQL?

I full joined 2 tables first and then full joined a 3rd table, now I got 1000 more rows in the result. But when I added a where statement following the join process I can only get 200 more rows and it seems that some expected rows were filtered. I don’t know what I’ve done wrong. Answer Your where clause

Problems with reserved field name ‘user’ in SAS Proc SQL

How do I select the user column from my table and not select the surprise ‘feature’ SAS added to their SQL syntax: Result: Bonus, the field name in the result table (if you create one) gets a temporary name… ie. something like _TEM001. Answer Use the name literal syntax, ‘<name>’n Name literals in other systems, such as in pass through:

SAS proc sql – is this the correct usage?

This works but wanted a health check as to if i have done this correct with proc sql connect to i.e do i need to have separate “select * from connection to’s”? Thanks Answer Since you are pulling from the same database just push the join into the database. While you are at it assign names to the variables when

Convert day of year to date using proc sql in SAS

I have a day of year column and need to convert it to a date.I want to find the exact date that the insurance coverage began for every person. I also have a year column Have data: Want data: I searched up and find that the following command works in Oracle sql but does not work in SAS sql I

How to use prxmatch or alternative for below string in sas

I have multiple rows of strings I want remove and create new column with 25% and 20% and so on… From above string. How can I do that in SAS? The new column should flow 25% i.e percentage. So on…. Answer A single percentage value (or none) can be retrieved from a string using a pattern with a grouping expression

how to pick the column with the highest value

I have a table with different possibilities of marital status (columns), how do I pick up the one with the highest value and keep the column name? For example, below is my original data set: data …

Advertisement