8/23/2023 0 Comments Sas date formats![]() So, rather than trying to finagle out the inter-system conversions, my first recommendation would be to get a date in denodo formatted in a way that SAS conversions will accept, and do the conversion in SAS. Since to_date gets us the date format, and you’re saying that SAS is importing this as a char. One last thing, the date formatting used in to_date is the format the date is in, so that it can recognize the date pattern, not the format you want it to be in. You also don’t need to cast effdate to varchar for any of these, they will accept the numeric value if they can be a date. ![]() To_date('dd-MM-yyyy',effdate) as "EDateSeven",įormatdate('dd/MM/yyyy', to_date('E MMM dd HH:mm:ss Z yyyy', effdate)) as "EDateEight"įirst things first, formatdate returns a string, which, unless cast to a date, or passed into to_date, will still be a string. ![]() To_date('yyyy-MM-dd',effdate) as "EDateFive",įormatdate('yyyy-MM-dd',to_date('yyyyMMdd',effdate)) as "EDateSix", To_date('yyyy-MM-dd',trim(cast(effdate as varchar(8)))) as "EDateFour", To_date('yyyyMMdd',effdate) as "EDateThree", To_date('yyyyMMdd',trim(cast(effdate as varchar(8)))) as "EDateTwo", Not sure if this is an issue with SAS but I expected at least some of them to return as dates.įormatdate('yyyy-MM-dd',to_date('yyyyMMdd',cast(effdate as varchar(8)))) as "EDate", Some of them will display like a date (), but don't return as actual dates, all of them return as chars. Here are some things I have tried to no avail. Ideally, I'd like it to output as a Date with the format of 15aug2018. No matter what I do, it seems to output in SAS as a char. I have tried numerous ways of converting it to a date. My input date (effdate) is numeric with a length of 8 and looks like 20180815. I have created a query in SAS that passes through Denodo via odbc connection (uses VQL syntax).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |