BookmarkSubscribeRSS Feed
GN0001
Barite | Level 11

Proc sql;

create table mytable as

select distinct b.*, 

if b.rate < 35 then '50th'

      else if < 50 then '75th'

            else if < 75 then '80th'

                else if >=75 'this is the one' as label = 'done'

, a.diagcode

from tableb b left join tablea a on....

 

Or if statement can't be used inside proc sql and we need to use case statement only?

Respectfully,

blue blue

 

Blue Blue
3 REPLIES 3
SASKiwi
PROC Star

I'm pretty sure we gave you the answer to this in another of your questions. There is no such thing as IF logic in SQL only CASE.

 

I've followed your progress on the Community with interest and respectfully I think you are missing some basic SAS concepts that would really speed up your learning.

 

I suggest you start using the free SAS online learning resources like this huge list of how-to tutorials    

And explore the SAS documentation 

These will really supercharge your learning!

 

GN0001
Barite | Level 11

I am so grateful to your response.

I have a couple of certificates in SAS. I am doing SAS Base currently, and I get any chance, I will listen to my tutorials again. I wish I had not gone for it at all!

I am currently covering The little SAS Book. 

I will go to the links you sent me, thank you very much. Unfortunately topics that I post here requires answers for my project that are due. SAS documentation is very technical and it is very hard to understand, at least for me.

 

I probably asked you this question before, but what happens is if I don't use them, I will lose them. The way you mentioned to me here, believe me, I wont' forget it.

Thanks for your advice and link you sent me.

Blue Blue

 

 

Blue Blue
SASKiwi
PROC Star

No problem. Best of luck on your SAS journey!

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
  • 3 replies
  • 520 views
  • 1 like
  • 2 in conversation