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

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

View solution in original post

6 REPLIES 6
AhmedAl_Attar
Rhodochrosite | Level 12

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
Rhodochrosite | Level 12

@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

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
ralizadeh
Obsidian | Level 7

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

ralizadeh
Obsidian | Level 7

Thanks @Reeza for sharing the document.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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