Hello everyone,
I searched the internet but I didn't find a way to work with UTC Local Brazil...
I have a datetime field that originally in the source it's like 2023-07-31 21:30:00
but in the database SAS 2023-08-01 21:30:00
I would like to check how I can work with UTC Brasil to resolve this issue. Could you help me please?
Thanks 🙂
Since 31/07 is in no way a complete date and you say you are using a data set created by someone else I think it is time to discuss with that user what the value looked like as text and how that person read the file.
While a person can read something like 31/07 and assume it is 31 July none of the default SAS tools will do such. SAS requires the YEAR to be part of the value and will assume the first day of the month when provided only year and month information. Which would most likely to treat 31 as 1931 and yield a day of 1 July 1931 unless you are using a datecutoff value that would treat it as year 2031.
Can you show us some raw values as text before they are read into SAS? Then the value SAS shows after reading?
It may help to show the code you used to read the source data as well.
I would expect maybe a few hours as a shift for time zone differences but not and entire 24 hours as shown.
@vvferreira wrote:
Hello everyone,
I searched the internet but I didn't find a way to work with UTC Local Brazil...
I have a datetime field that originally in the source it's like 2023-07-31 21:30:00
but in the database SAS 2023-08-01 21:30:00
I would like to check how I can work with UTC Brasil to resolve this issue. Could you help me please?
Thanks 🙂
Value of System
Value in Database
I read a table that has already been entered in SAS by another user. I Read the table like this:
DATA TMP_VALUE_COLUMN;
SET TMP_SCRIPT;
RUN;
Since 31/07 is in no way a complete date and you say you are using a data set created by someone else I think it is time to discuss with that user what the value looked like as text and how that person read the file.
While a person can read something like 31/07 and assume it is 31 July none of the default SAS tools will do such. SAS requires the YEAR to be part of the value and will assume the first day of the month when provided only year and month information. Which would most likely to treat 31 as 1931 and yield a day of 1 July 1931 unless you are using a datecutoff value that would treat it as year 2031.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.