SAS Tutorial | How to Concatenate Values in SAS

  Рет қаралды 11,624

SAS Users

SAS Users

Күн бұрын

Пікірлер: 32
@andyravenna4222
@andyravenna4222 4 жыл бұрын
Hey everyone! Thanks for checking out my video on concatenation. I got an email from SAS Technical Support that pointed out one inaccuracy. In my very first example, even though it *looks* like there is a space between "Age:" and the persons age, it actually got trimmed out by the CATS function. If you *really* want a blank space after "Age:" you could use just the CAT function like this: combo = cat(trim(name), ', Age: ', age); This example uses the trim function to get rid of any extra blanks in the name, but respects the one after "Age:". Enjoy! -Andy
@negusuworku2375
@negusuworku2375 2 жыл бұрын
Thank you. Very help full. I was laughing when you said no dog function......smile...
@SASUsers
@SASUsers 2 жыл бұрын
Glad you found it helpful! 🐶
@savannah5911
@savannah5911 11 ай бұрын
good video i learned a lot thanks hank
@bikusbikus
@bikusbikus 11 ай бұрын
🌽
@SASUsers
@SASUsers 11 ай бұрын
Thanks for tuning in!
@rogerward8047
@rogerward8047 4 жыл бұрын
This is excellent, Andy! I am glad you did this tutorial.
@andyravenna4222
@andyravenna4222 4 жыл бұрын
Thanks Roger!
@djrisks
@djrisks 4 жыл бұрын
Great video Andy!
@andyravenna4222
@andyravenna4222 3 жыл бұрын
Thank you Kriss!
@Mgilsy
@Mgilsy 3 жыл бұрын
Great video. Thanks. Love the extra tips at the end.
@SASUsers
@SASUsers 3 жыл бұрын
Glad it was helpful!
@thepineweaver
@thepineweaver 3 жыл бұрын
Super helpful!
@SASUsers
@SASUsers 3 жыл бұрын
Awesome! Glad you enjoyed it!
@bifurkacia
@bifurkacia 2 жыл бұрын
Great tutorial, thank you!
@SASUsers
@SASUsers 2 жыл бұрын
Glad it was helpful!
@zahirraihan80
@zahirraihan80 Жыл бұрын
Excellent!!
@SASUsers
@SASUsers Жыл бұрын
Glad you like it!
@oluwafemijohnson8422
@oluwafemijohnson8422 2 жыл бұрын
Hi Andy, thanks for this video. I found it very helpful. Please, I need your help to solve a problem I had after I concatenated "Lastname, first name and middle name. I want middle initials. e.g., Johnson, Smart B. However, I was successful doing that but I have two different people in different departments with the names (e.g., Smith, Johnson L maybe in English dept and another person bearing the same Smith, Johnson L in French Dept). Please how can I solve this problem before joining the data set?
@SASUsers
@SASUsers 2 жыл бұрын
Oluwafemi, We can't answer detailed usage questions or provide code here in the KZbin feedback area. For usage questions about SAS procedures and your data, your best resources are either Tech Support or the SAS Community Forum. To open a track with Tech Support, fill out the form at this link: 2.sas.com/6055KQyt1 . For help from SAS employees and users, you can post general questions in the Statistical Procedures forum: 2.sas.com/6056KQytG
@ernestcpena
@ernestcpena 6 ай бұрын
Andy!!!
@ToOpen6seven
@ToOpen6seven 8 ай бұрын
How would you put together two vars - one has the numeric value of 99 and the other contains numeric vals of (1,2,3, etc.) I want the new var to be 99.01 or 99.02 etc.
@SASUsers
@SASUsers 8 ай бұрын
For programming/content related questions, we'd recommend posting on SAS Communities where experts are on hand to help with usage recommendations 2.sas.com/6052njLmw
@bailandoasolas
@bailandoasolas 3 жыл бұрын
Hey Andy, great video. But I have a question, how can I do when I have a character like this: $390,000? Regrets from Mexico
@SASUsers
@SASUsers 3 жыл бұрын
Brenda, thank you for your inquiry! We are checking on this for you!
@SASUsers
@SASUsers 3 жыл бұрын
Brenda, This video shows how to use the concatenation or CAT family of functions (like CAT, CATS, CATT, CATX). The CAT family of functions will work with both numeric and character values. Your question is not entirely clear. If you want to concatenate a character variable that holds the value of $390,000, that should not be an issue at all with the CAT functions. For example, to concatenate a character variable and a numeric variable, you can see an example of this in the very first example in the video on using the CATS function, at approximately time stamp 04:00 where the variable NAME and AGE are concatenated. If you have a numeric variable that contains the raw data value 390000 and you want to add dollar signs and comma separators while you also concatenate, then you would have to use a PUT function nested inside your CAT function. We teach about the PUT function in our Programming 1 and Programming 2 classes. This KZbin feedback area really doesn't allow us to post code or screen shots. Your best resources for questions like this are to either open a track with Tech Support or to post your question in the SAS Community Forums, with more details about your question. The SAS Programming forum 2.sas.com/6059H2T5H would be a good place to start with a question like this.
@sagarkothari5898
@sagarkothari5898 2 жыл бұрын
How would I run the same query when I want to keep all the columns of the said file and Add the additional concatenated column in the same file
@SASUsers
@SASUsers 2 жыл бұрын
Checking on this for you!
@SASUsers
@SASUsers 2 жыл бұрын
Unfortunately, we can't post code or screenshots in this KZbin feedback area. But we can give you some idea of how to keep all the variables from the input dataset, along with the new variable from the concatenation. It involves just using basic SAS coding techniques. Consider the code at time stamp 2:41. In that code snippet, the narrator is creating 2.sas.com/6055zAzp5 and the KEEP= option is only going to cause only 1 variable (COMBO) to be saved in 2.sas.com/6055zAzp5. Without the KEEP= option, ALL the variables in SASHELP.CLASS plus the new COMBO variable would be written to 2.sas.com/6055zAzp5. This is one of the fundamentals of SAS programming -- using DROP and KEEP to control variables in the output data set. If you have further questions about concatenating variables and writing SAS code, your best resources will be to post a question, with some sample data in the Community Forums, such as the Programming forum, here: 2.sas.com/6056zAzpg.
@andyravenna4222
@andyravenna4222 4 жыл бұрын
I hope you enjoy learning about the CAT function (while seeing some other cats!) Please do let me know if you have any comments or questions. Thanks! Andy
@aswinip7579
@aswinip7579 4 жыл бұрын
Can you please make a video on proc template.
@SASUsers
@SASUsers 4 жыл бұрын
Aswini, thanks for your feedback! You may also find this paper helpful 2.sas.com/6050GLweq
SAS Tutorial | Combining Data in SAS: DATA Step Versus SQL
16:37
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 275 #shorts
00:29
The Excel Functions Almost Everyone Overlooks (Better Than SUMIFS)
10:29
MyOnlineTrainingHub
Рет қаралды 64 М.
🚨 YOU'RE VISUALIZING YOUR DATA WRONG. And Here's Why...
17:11
Adam Finer - Learn BI Online
Рет қаралды 223 М.
SAS Tutorial | Simple Linear Regression in SAS
33:29
SAS Users
Рет қаралды 35 М.
SAS Tutorial | If-Then / Else Statements
11:51
SAS Users
Рет қаралды 4,4 М.
Ultimate Guide to Polars - Fastest Python Data Science Library!
20:54
Python Simplified
Рет қаралды 10 М.
SAS Tutorial | 3 Steps to Build a SAS Macro Program
14:24
SAS Users
Рет қаралды 23 М.
Excel LAMBDA - HOW & WHEN you Should use it
16:02
Leila Gharani
Рет қаралды 445 М.
This is how I actually clean data using Power Query
27:49
Mo Chen
Рет қаралды 45 М.