Desktop productivity for business analysts and programmers

Removing date information

Reply
Contributor
Posts: 35

Removing date information

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.
Super Contributor
Posts: 260

Re: Removing date information

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
Contributor
Posts: 35

Re: Removing date information

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 )
Ask a Question
Discussion stats
  • 2 replies
  • 86 views
  • 0 likes
  • 2 in conversation