SAS is closely monitoring the global CrowdStrike Falcon update issue. SAS is currently not affected by these outages, and we have seen no disruptions to our core systems or services. We will continue monitoring the situation and will provide updates on the SAS Support site if needed.
Please I need help with the SAS code below that does not produce expected reuslt:
Consider the hospital Admit label “HOSP_ADMSN_TIME” is a character variable as below and the hospital discharge time “HOSP_DISCH_TIME” is a character variable as below, and compute the length of stay “LOS” using SAS.
HOSP_ADMSN_TIME
Char
17
$17.
$17.
HOSP_ADMSN_TIME
HOSP_DISCH_TIME
Char
17
$17.
$17.
HOSP_DISCH_TIME
Example of the character data as in excel is as below
HOSP_ADMSN_TIME
HOSP_DISCH_TIME
2022-05-12 11:35:00
2022-05-21 15:46:00
2022-05-12 11:35:00
2022-05-21 15:46:00
2022-05-12 11:35:00
2022-05-21 15:46:00
2022-05-12 11:35:00
2022-05-21 15:46:00
2022-05-12 11:35:00
2022-05-21 15:46:00
2022-05-12 11:35:00
2022-05-21 15:46:00
I used the following code to compute length of stay but the result is wrong please help.
data new_count;
set new_count;
/* Convert character HOSP_ADMSN_TIME to numeric datetime */
dt_HOSP_ADMSN_TIME = input(HOSP_ADMSN_TIME, anydtdtm19.);
/* Convert character HOSP_DISCH_TIME to numeric datetime */
dt_HOSP_DISCH_TIME = input(HOSP_DISCH_TIME, anydtdtm19.);
/* Calculate the Length of Stay (LOS) in days */
LOS = (dt_HOSP_DISCH_TIME - dt_HOSP_ADMSN_TIME) / (60*60*24); /* Convert seconds to days */
/* Format the datetime variables for readability */
format dt_HOSP_ADMSN_TIME datetime19. dt_HOSP_DISCH_TIME datetime19.;
/* Drop the original character variables if not needed */
drop HOSP_ADMSN_TIME HOSP_DISCH_TIME;
/* Rename the new datetime variables to the original names */
rename dt_HOSP_ADMSN_TIME = HOSP_ADMSN_TIME
dt_HOSP_DISCH_TIME = HOSP_DISCH_TIME;
run;
... View more
Is there any easy way to calculate sample size for a Poisson model with offset? I am planning a cohort study with recurrence short term outcome. That is, one participant can get the outcome multiple times during the follow-up period.
... View more
Hello,
I have following code that can be run as is:
data test;
length Make $13.;
declare hash found_keys();
found_keys.definekey('Make','Model');
found_keys.definedone();
do while (not done);
set sashelp.cars end=done;
rc=found_keys.add();
output;
end;
stop;
run;
I tried to put it into an macro but somehow it won't work. Could anyone tell me why? what should I do in order to resolve the issue?
%macro m_test(key=);
data test;
length Make $13.;
declare hash found_keys();
found_keys.definekey(&key.);
found_keys.definedone();
do while (not done);
set sashelp.cars end=done;
rc=found_keys.add();
output;
end;
stop;
run;
%mend;
%m_test(key=%bquote('Make', 'Model'));
... View more
Hi all,
On my Enterprise Guide someone likely switched of any further updates. I assume this is the reason why the update to 8.4 is not showing. Is there a way to revert the earlier decision to not show any updates for current version?
Some configuration file or so?
Thanks in advance
... View more
Hi everyone, I am trying to implement radar plot visualizations in SAS Viya. Unfortunately, this tool is unavailable within the objects . I really appreciate your help to implement new visualizations, radar plots in SAS Viya. Thank you,
... View more
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
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 16.