BookmarkSubscribeRSS Feed
stephenjdunn
Calcite | Level 5

Hi

Is there a way of creating calculated columns with the query builder in SAS Studio (SAS9.4 M2 for Linux) like there is in Enterprise Guide? It's pretty useless as a query tool without it! 

4 REPLIES 4
Reeza
Super User

I can't see a way by default, but the code generated is below and can be modified, so you can add your computed column directly to the code. 

 

This doesn't mean one doesn't exist - just that it's not intuitively obvious. 

 

Annoying, but easily worked around for sure. 

 

 

stephenjdunn
Calcite | Level 5

Hi

I can see you can generate code and edit it but it sort of destroys the point of visual programming. Odd that they have not incorporated such a basic feature. It makes it a hard sell to get the team to use visual programming if the functionality is very low.

vazmena1
Calcite | Level 5

Please could you provide the code? I have the same problem. Thanks

Reeza
Super User

@vazmena1 wrote:

Please could you provide the code? I have the same problem. Thanks


Please post a new question, not add on to a several year old one. 

 

Build your code using the query builder and then copy the code to a code node. Then manually add in the calcuations you want. 

 

It follows the format below, in red, with the BMI calculation. 

 

proc sql;
create table WANT as
select age, name, weight,   weight/height**2 as BMI 
from sashelp.class;
quit;  

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2858 views
  • 1 like
  • 3 in conversation