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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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