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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 887 views
  • 0 likes
  • 2 in conversation