BookmarkSubscribeRSS Feed
kranikai_2
Calcite | Level 5
Why does

my_date = mdy ('08', '06', '2010');

work perfectly well inside data steps, but inside proc sql, it generates an error message:

ERROR: Function MDY requires a numeric expression as argument 1.
ERROR: Function MDY requires a numeric expression as argument 2.
ERROR: Function MDY requires a numeric expression as argument 3.
3 REPLIES 3
Patrick
Opal | Level 21
MDY requires numeric values as input. Your statement should therefore look like:
my_date = mdy (08, 06, 2010);

The data step seems to be more tolerant but even there you get the following note with you code:

NOTE: Character values have been converted to numeric values

HTH
Patrick
kranikai_2
Calcite | Level 5
> The data step seems to be more tolerant

That's just what I'm wondering. For me, it seems somewhat illogical that rules concerning data types may vary depending on context.

Well, this causes no real practical problems for me, I'm just curious and would like to know why the language has been designed in that way. Plus, I have to remember what is allowed where.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you contact SAS tech support with your concern - unless you are merely broadcasting into this digital fjord, not necessarily looking for a response from an audience, comprised mostly of SAS users, not SAS software developers.

Scott Barry
SBBWorks, Inc.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 5319 views
  • 0 likes
  • 3 in conversation