- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
below is my data:
I want to create above dates in ISO date format like 2019-02-28 & 2019-03-18.
Could you please help me with this.
Thanks,
Adithya
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
want=input(AESTDAT_RAW,anydtdte20.);
format want yymmdd10.;
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
want=input(AESTDAT_RAW,anydtdte20.);
format want yymmdd10.;
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If the values really look like that then the DATE informat should work, just make sure to use a long enough width.
aestdat_date = input(aestdat_raw,date11.);
format aestdat_date yymmdd10.;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
We have a Table with a date in format MMM-19. Example MAY-19. Is there a way to generate a new sortable date column from this format? Preferably 2019-05-31 in this example. Any help would be much appreciated.
The last date in the month would be preferred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You should create your own thread instead, but here is an example that works if the date is an actual string and not just a formatted numeric value. If it is numeric to begin with, just use the intnx function.
data want;
date_s = "MAY-19";
date_n = input(compress(date_s,"-"),monyy.);
end_date_n = intnx ('month',date_n,0,'E');
format date_n end_date_n yymmdd10.;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I wish to use SL_FSCL_PERIOD to generate a new column named SL_FSCL_PERIOD_DT.
PROC SQL;
CREATE TABLE RXFFDM.ORCL_SL_JE_DTL_DT AS
SELECT *,
put(intnx ('month',SL_FSCL_PERIOD,0,'E')) format=yymmdd10. as SL_FSCL_PERIOD_DT
FROM RXFFDM.ORCL_SL_JE_DTL;
Quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is that variable a string or a SAS numeric date? Do you want the variable to be a SAS date or a string?
If it is a numeric, then you just have to change the format of that column to yymmdd10.
If it is a string, then you have to use an input function to translate it to a SAS date.
E.g.
data have;
aestdat_raw = "28 feb 2019";
run;
data want;
set have;
aestdat_date = input (compress(aestdat_raw), date9.); *Use compress to remove the spaces, or you will get the year 2020!;
format aestdat_date yymmdd10.;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
got it below is my code for my question:
want=input(AESTDAT_RAW,anydtdte20.);
format want yymmdd10.;
Thanks!