- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-03-2010 06:06 AM
(6016 views)
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
> 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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Scott Barry
SBBWorks, Inc.