BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ralizadeh
Obsidian | Level 7

I am not asking how to right a code. I am asking how to use Tasks in SAS EG to create such a statement.

 

I have an 'age' column and would like to group them into '<18', 'between 18 and 65', and '65+'.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

You can use the Query Builder tool and "Recode" a column. In Query Builder, select Computed Columns, then New->Recode Column.

 

Through point and click selections, this will build a CASE statement.

ChrisHemedinger_0-1683046046923.png

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

View solution in original post

6 REPLIES 6
AhmedAl_Attar
Ammonite | Level 13

Hi @ralizadeh 

You may want to look at this SAS Blog Entry : Creating a SAS format from a data set

Additional Info can be found here: SAS Enterprise Guide - Custom Tasks

 

One way of Binning values is using Formats.

 

Hope this helps

 

AhmedAl_Attar
Ammonite | Level 13

@ralizadeh 

I just checked my EG 7.15 & 8.1 -- Under the Data Tasks, you should be able to find

- Create Format...

- Create Format from Data Set...

 

ChrisHemedinger
Community Manager

You can use the Query Builder tool and "Recode" a column. In Query Builder, select Computed Columns, then New->Recode Column.

 

Through point and click selections, this will build a CASE statement.

ChrisHemedinger_0-1683046046923.png

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
ralizadeh
Obsidian | Level 7

Thank you @ChrisHemedinger. You SAS guys here are awesome! 😀

ralizadeh
Obsidian | Level 7

Thanks @Reeza for sharing the document.

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 6 replies
  • 2073 views
  • 4 likes
  • 4 in conversation