- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 10-20-2009 02:41 PM
(1450 views)
The date format is not consistent across the observations.
the first few rows has 09/18/2009 format and after which some rows will have
Sep-09 format.
How to make the date field consistent like mmddyy10. format?
the first few rows has 09/18/2009 format and after which some rows will have
Sep-09 format.
How to make the date field consistent like mmddyy10. format?
5 REPLIES 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is this a SASDATE variable or text. It must be text for this to happen. Give us some information on what type of data you have.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
text.
This is how i get my date field:
SHIP_DATE
09/22/2009
09/18/2009
09/22/2009
09/18/2009
Sep-09
Sep-09
This is how i get my date field:
SHIP_DATE
09/22/2009
09/18/2009
09/22/2009
09/18/2009
Sep-09
Sep-09
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This will do it.
------------------------------------
data test;
format SHIP_DATE mmddyy10.;
input SHIP_DATE : anydtDTE10.;
cards;
09/22/2009
09/18/2009
09/22/2009
09/18/2009
Sep-09
Sep-09
;
run;
--------------------
------------------------------------
data test;
format SHIP_DATE mmddyy10.;
input SHIP_DATE : anydtDTE10.;
cards;
09/22/2009
09/18/2009
09/22/2009
09/18/2009
Sep-09
Sep-09
;
run;
--------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you are still working on translating those Excel spreadsheets, this is probably more what you are looking for.
------------------------------
data test;
length SHIP_DATE $10;
input SHIP_DATE;
cards;
09/22/2009
09/18/2009
09/22/2009
09/18/2009
Sep-09
Sep-09
;
run;
data test2;
set test;
format SHIP_DATE_DT mmddyy10.;
SHIP_DATE_DT = input(SHIP_DATE,anydtDTE10.);
run;
-----------------------------
------------------------------
data test;
length SHIP_DATE $10;
input SHIP_DATE;
cards;
09/22/2009
09/18/2009
09/22/2009
09/18/2009
Sep-09
Sep-09
;
run;
data test2;
set test;
format SHIP_DATE_DT mmddyy10.;
SHIP_DATE_DT = input(SHIP_DATE,anydtDTE10.);
run;
-----------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
input dateinfo anydtdte21.;