BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
chevy37
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Anotherdream
Quartz | Level 8

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

1 REPLY 1
Anotherdream
Quartz | Level 8

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

bday=mdY(abthmo,abthdy,abthyr);


same for your interview day

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 1287 views
  • 1 like
  • 2 in conversation