BookmarkSubscribeRSS Feed
Fluorite | Level 6

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?

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
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.


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.



Data never sleeps
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?


Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.


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.

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