You could use an informat to translate the state name into a minute offset :
proc format;
invalue timeZone
"TX" = -60
"NY" = 0
OTHER = 0
;
run;
data have;
infile datalines dsd dlm=".";
input STATE :timeZone. (START END) (:MDYAMPM.);
TX_start = intnx("MINUTE",START, STATE);
TX_end = intnx("MINUTE", END, STATE);
format TX_: dateampm.;
datalines;
TX. 02/07/16 01:59 AM. 02/07/16 02:02 AM.
;
You could use an informat to translate the state name into a minute offset :
proc format;
invalue timeZone
"TX" = -60
"NY" = 0
OTHER = 0
;
run;
data have;
infile datalines dsd dlm=".";
input STATE :timeZone. (START END) (:MDYAMPM.);
TX_start = intnx("MINUTE",START, STATE);
TX_end = intnx("MINUTE", END, STATE);
format TX_: dateampm.;
datalines;
TX. 02/07/16 01:59 AM. 02/07/16 02:02 AM.
;
Is there any chance you're going to be dealing with Texas times in the El Paso region? El Paso is Mountain Time zone.
if you have the SAS supplied SASHELP.Zipcode data set (or download it) there is time offset and daylight savings time information by Zip code that may be of use.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.