DATA Step, Macro, Functions and more

Working with dates in SAS

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Working with dates in SAS

Hello,

I'm working with SAS 9.3 and having trouble.  I am trying to figure out the age of people by subtracting everyone's date of birth from their interview date.  Here is the syntax I have created in order to create the bday and interview variables along with the error messages that are haunting me.

bday = mdy (abthmo abthdy abthyr) ;

                                 ------

                                  388

                                  202

           ----

           71

interv = mdy (pintmo pintda pintyr) ;

                                 ------

                                  388

                                  202

ERROR 388-185: Expecting an arithmetic operator.

ERROR 202-322: the option or parameter is not recognized and will be ignored.

ERROR 71-185: The MDY function call does not have enough arguments.


Accepted Solutions
Solution
‎09-19-2013 02:40 PM
Super Contributor
Posts: 418

Re: Working with dates in SAS

You aer missing commas in your MDY function. Should be.

bday=mdY(abthmo,abthdy,abthyr);


same for your interview day

View solution in original post


All Replies
Solution
‎09-19-2013 02:40 PM
Super Contributor
Posts: 418

Re: Working with dates in SAS

You aer missing commas in your MDY function. Should be.

bday=mdY(abthmo,abthdy,abthyr);


same for your interview day

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 290 views
  • 1 like
  • 2 in conversation