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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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