BookmarkSubscribeRSS Feed
YannRC
Obsidian | Level 7

Hi, i'm not sure to be in the good location. I prepare data with sas data studio. I want to sort my data with a date. I know that i can use a function in studio with case and INTCK but i would like to do this on SAS data studio by using a calculated collumns. But i dont' find the function case and if i use IF, i have an error. Can you help me?

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Show us the log for your code (all of it, not just the errors)

 

Show us a portion of your data.

--
Paige Miller
ballardw
Super User

CASE as a statement pretty much only exists in Proc SQL and is not a function. So I am pretty confused as to what sort of code you even attempting.

 

LinusH
Tourmaline | Level 20

The calculated column transformation accept data step syntax, but does not allow conditional values. Help within the product:

"Creating Calculated Columns

To create a calculated column, enter a DATA step expression in the Expression field. A few considerations:
  • Do not include the name of the table, semicolons, or the column= statement in the expression. They are implicitly added for you.
  • Enter a single value or single expression only. Do not enter conditional values.

For more information about creating calculated columns, see Creating Calculated Columns in SAS Data Studio: User’s Guide."

 

That being said, INTCK should work.

If wish to do conditional processing, use IFC/IFN functions rather than the corresponding statements.

LinusH_0-1696939718323.png

 

Data never sleeps
Tom
Super User Tom
Super User

Perhaps this is an actual use case for the IFN() or IFC() functions that SAS added a few years ago?

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 4 replies
  • 1516 views
  • 1 like
  • 5 in conversation