Hi everyone …
I’d like to ask if anyone knows or can suggest any SAS functions for working with and manipulating datetime values and time zones. I’m using SAS 9.1 running on z/OS. I will try to explain my objective.
I have seven separate SAS data sets for each day of the week and each SAS data set contains data related to that day’s work (e.g. Monday’s data set contains data related to jobs that ran on Monday, on a GMT calendar, etc…). Each SAS data set is refreshed the following week so the previous week’s data is lost if not obtained within that week.
Unfortunately, the time when these SAS data sets are populated with data is not consistent (e.g. run time of the job that populates these data sets vary, the job may be held, etc…).
My thought is to read in all SAS data sets to ensure that no data is missed and specify what records I need in my program. The timestamps in the input data sets are stored in DATETIME21.2 in the GMT time zone.
My dilemma is that I work in California and between the second Sunday of March and the first Sunday of November, I’m seven hours behind GMT (the rest of the year, I’ll be eight hours behind). I’m not sure if SAS has a function to determine the current time zone offset or if I have to manually code this.
Once written, the program will be added to a scheduler so no human interaction will be performed so the program needs to be able to run without any input other than the source data.
Does anyone have any suggestions?
Thanks in advance …
K
I’d like to ask if anyone knows or can suggest any SAS functions for working with and manipulating datetime values and time zones. I’m using SAS 9.1 running on z/OS. I will try to explain my objective.
I have seven separate SAS data sets for each day of the week and each SAS data set contains data related to that day’s work (e.g. Monday’s data set contains data related to jobs that ran on Monday, on a GMT calendar, etc…). Each SAS data set is refreshed the following week so the previous week’s data is lost if not obtained within that week.
Unfortunately, the time when these SAS data sets are populated with data is not consistent (e.g. run time of the job that populates these data sets vary, the job may be held, etc…).
My thought is to read in all SAS data sets to ensure that no data is missed and specify what records I need in my program. The timestamps in the input data sets are stored in DATETIME21.2 in the GMT time zone.
My dilemma is that I work in California and between the second Sunday of March and the first Sunday of November, I’m seven hours behind GMT (the rest of the year, I’ll be eight hours behind). I’m not sure if SAS has a function to determine the current time zone offset or if I have to manually code this.
Once written, the program will be added to a scheduler so no human interaction will be performed so the program needs to be able to run without any input other than the source data.
Does anyone have any suggestions?
Thanks in advance …
K