BookmarkSubscribeRSS Feed
rab24
Calcite | Level 5
I know it sounds strange, but I need to remove information from a date variable going from a variable that includes day of the month to just month. It is part of a deidentification process so a simple format change is not sufficient. Any suggestions on how to permanently restrict my data?

Thanks.
2 REPLIES 2
Olivier
Pyrite | Level 9
You can try :
1) creating a character variable with the formula PUT(myDate, MMYYS7.) and your new variable will only contain month and year
2) create a new date variable with the formula INTNX("MONTH",myDate,0) and you new variable will be located on the 1st of the month
rab24
Calcite | Level 5
Thanks Olivier, that works perfectly.

To SAS proper, I'm sure more experienced users probably wouldn't have a problem understanding this, but instead of the syntax intnx( 'month', date, 0) the Enterprise Guide help has the syntax example as intnx( 'month', date, 0, beg )

sas-innovate-2024.png

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!

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
  • 2 replies
  • 693 views
  • 0 likes
  • 2 in conversation