In a DATA step, you will need to construct a suitable SAS character variable, one having a format that is suitable for any of the SAS-default INFORMATs. You can use the SUBSTR or possibly the SCAN function to parse your character values.
Here is an example:
1 data _null_;
2 retain year '2009-2005' month '1-12';
3 cmydate = scan(year,1,'-') !! '-' !! scan(month,1,'-') !! '-01';
4 format mydate date9.;
5 mydate = input(cmydate,yymmdd10.);
6 put _all_;
7 run;
year=2009-2005 month=1-12 cmydate=2009-1-01 mydate=01JAN2009 _ERROR_=0 _N_=1
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 second
Scott Barry
SBBWorks, Inc.