BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
vvferreira
Calcite | Level 5

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 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

3 REPLIES 3
ballardw
Super User

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 🙂


 

vvferreira
Calcite | Level 5

Value of System

vvferreira_0-1694710645236.png

 

Value in Database

vvferreira_1-1694710695528.png

 

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;

 

ballardw
Super User

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.

sas-innovate-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 160 views
  • 0 likes
  • 2 in conversation