🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 10-04-2016 01:20 PM
(1853 views)
hi,
I have a character date variable 11292000 wich I would like to convert into 20001129.
I used:
data want ;
set have ;
newdate=input (olddate, yymmdd8. ); but the code does not work.
any ideas? thanks
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Of course that wouldn't work. You were telling SAS to read the value 1129 as the year.
data want ;
set have ;
newdate=input (olddate, mmddyy8. );
FORMAT newdate yymmdd8.;
run;
You may get warnings about conversion of numeric to character if your olddate variable is numeric as INPUT expects character values.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Of course that wouldn't work. You were telling SAS to read the value 1129 as the year.
data want ;
set have ;
newdate=input (olddate, mmddyy8. );
FORMAT newdate yymmdd8.;
run;
You may get warnings about conversion of numeric to character if your olddate variable is numeric as INPUT expects character values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
oh I see.
Never mind I fixed it. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@archibald Please mark the question as solved.