BookmarkSubscribeRSS Feed
sathya66
Barite | Level 11

All,

We have a file landing in S3 in UTC time zone but our sas is in GMT time zone. How can we change our SAS session to UTC.

 

ex:test,txt is landing at 12:30 AM Monday. If I try to read that file through sas(If file is updated today then read the file ,file is showing updated 11:30 PM yesterday ) but  it is not picking up because of UTC time.

 

Thanks,

SS

 

3 REPLIES 3
ballardw
Super User

I don't think I quite understand your issue.

 

Is the time that a SAS program is supposed to run the issue? Is the schedule starting that program in SAS? If so, how is that program scheduled?

 

Or is the issue that the time values SAS reads are showing incorrectly?

  • The TZONES2U( ) converts a SAS datetime value to a UTC datetime value.
  • The TZONEU2S( ) function converts a UTC datetime value to a SAS datetime value.
sathya66
Barite | Level 11

Its a manual run not scheduled yet.  

 the issue is that the time values SAS reads are showing incorrectly.

I will try with TZONES2U( ) .

thanks for your help.

Tom
Super User Tom
Super User

You can change the TIMEZONE option.

https://documentation.sas.com/?docsetId=nlsref&docsetTarget=p15siqs0s00e50n1wuuvygzkr14r.htm&docsetV...

Looks like you can change it on the fly if you want.

1327  %put timezone=%sysfunc(getoption(timezone)) %sysfunc(datetime(),datetime20.);
timezone=   20JUL2020:13:42:49
1328  options timezone='GMT';
1329  %put timezone=%sysfunc(getoption(timezone)) %sysfunc(datetime(),datetime20.);
timezone='GMT'   20JUL2020:17:42:49
1330  options timezone='EDT';
1331  %put timezone=%sysfunc(getoption(timezone)) %sysfunc(datetime(),datetime20.);
timezone='EDT'   20JUL2020:13:42:49
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1465 views
  • 3 likes
  • 3 in conversation