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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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