BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8
proc sql;
create table curr_util as 
select org, 
acc,
"curr_util" as sum_type,
sum(BAL,PBI_BAL)/LIMIT as sum_value,
from pbi;

what does this quotation mark doing here? why is it required?

 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

For SAS to understand that the programmer means you have a text string, the text string must be in quotes. Otherwise, if you write curr_util without the quotes, SAS thinks that curr_util is the name of a variable.

--
Paige Miller
Astounding
PROC Star

Quotation marks have the same meaning throughout all applications of the SAS software.

 

No quotation marks refers to a variable's value.  It would mean the value of the variable CURR_UTIL should be the value assigned to the new variable SUM_TYPE.

 

Quotation marks refers to a set of characters.  It would mean the nine characters "curr_util" should be assigned to the new variable SUM_TYPE (same value for every observation).

ballardw
Super User

For many "why" questions I ask the original programmer if possible. Or read any comments.

 

The result is adding the same literal text to all of the records in a new variable.

 

When I see a variable containing the value of a data set name like this I suspect that somewhere else this result is combined with some other data and this variable indicates which data set contributed the record.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 734 views
  • 0 likes
  • 4 in conversation