data have;
infile cards ;
input ID $Date1 ;
cards;
001 200404
002 201205
003 200903
;
run;
I have a data with date variable entered into a character format. Would it be possible to: 1) assign all dates a day of "01" and 2) convert the variable to SAS date
Output
001 04012004
002 05012012
003 03012009
;
Yes, of course, something like
data want;
set have(rename=(Date1 = DateStr));
Date = input(cats(DateStr, '01'), yymmdd8.);
format Date mmddyy8.;
run;
Yes, of course, something like
data want;
set have(rename=(Date1 = DateStr));
Date = input(cats(DateStr, '01'), yymmdd8.);
format Date mmddyy8.;
run;
Super! thank you!
data want;
set have;
sasdt=input(cats(date1,'01'),yymmdd8.);
format sasdt mmddyyn8.;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.