Hi All, I have a dataset which looks something like the example provided below. In this example, my desired output would keep only the first observation for each ParticipantID. However, I need the values for Nurse and Team to be put into this first observation (which is currently blank). So, for this example, the output for ParticipantID=1 should have StartDate=8/1/2024, EndDate=8/16/2024, EndReason=Unknown, Nurse = A, Team=1. Any suggestions?
... View more
Hi Community, I have a requirement to summarize a table with dates. Any help is appreciated. Raw data: SubjectName QueryID ParentQueryID OpenDate 0001-S002 818930 818929 21-Nov-22 0001-S002 818929 782251 21-Nov-22 0001-S002 782251 24-Oct-22 01659-S031 962154 7-May-24 01659-S031 962200 962154 8-May-24 01659-S031 962462 962200 17-May-24 Each Query has a unique ID and any Re-query has a new Query ID with the parent Query ID in a second column. I am trying to summarize the information based on the master Query ID and Query Start and Query Stop dates. Expected output: SubjectName Master QueryID Query Start QueryEnd 0001-S002 782251 24-Oct-22 21-Nov-22 0001-S031 962154 7-May-24 17-May-24 Please advise with any approach/logic. Any help is appreaciated. Thank you for your time.
... View more
Could anyone tell me why this sometimes happens if I do not explicitly include an else statement? I was expecting b321 to only equal 1 for nAtBat=321. Most of the time I have no problems with this, but once in awhile I spend half the day troubleshooting and am usually so fed up that I just add all the else statements and say good riddance. But I would like to understand why this happens. To be clear, nAtBat is the 2nd field. I appreciate any input! data bb;
retain b321 nAtBat;
set sashelp.baseball;
if nAtBat=321 then b321=1;
run;
... View more
Dear all,
This might be a general question.
I am curious, if the traditional SAS OQ can run in the SAS Viya Workbench, or something similar.
This functionality is important for the Qualification process (GxP) in the Life Sciences industry.
Thank you in advance! Best regards,
Juan
... View more
I want to know how many clients in each clinic stayed at a different clinic and the cost of the stay at the different clinic. I am not considering order of the stays. I do not want to count a client if they have a different stay in the same clinic (see client L).
Thank you for your help!
data have;
input
client$ Span_Begin :DATE9. Span_End :DATE9. clinic$ stay cost;
format Span_Begin MMDDYY10. Span_End MMDDYY10. ;
datalines;
A 17Nov2022 04Jan2023 8 1 1373
B 01Jul2022 29Jul2022 12 1 2746
B 21Nov2022 04Apr2023 12 2 1373
C 01Jul2022 07Jul2022 8 1 2403
D 01Jul2022 12Jul2022 10 1 5479
E 01Jul2022 23Mar2023 9 1 159000
F 22Nov2022 19Mar2023 8 1 6522
G 26Aug2022 15May2023 12 1 687
H 01Oct2022 10Apr2023 6 1 5479
I 30Dec2022 19Jan2023 5 1 8675
J 01Jul2022 01Nov2022 3 1 4566
K 11Nov2022 10Jan2023 3 2 10044
L 01Jul2022 15Jul2022 3 3 9588
L 26Jul2022 17Aug2022 12 1 2060
L 23Sep2022 19Feb2023 12 1 5149
O 20Sep2022 20Feb2023 5 1 5022
P 01Jul2022 02Aug2022 5 1 913
Q 06Jul2022 01Sep2022 8 1 343
R 01Jul2022 01Sep2022 1 1 457
S 01Jul2022 24Oct2022 2 1 10957
T 01Jul2022 04Dec2022 2 1 1826
U 28Aug2022 18Sep2022 8 1 6179
V 19Dec2022 31May2023 7 2 10501
W 08Jun2023 18Jun2023 7 3 5022
X 01Jul2022 10Jul2022 8 1 3433
Y 04Aug2022 17Nov2022 10 2 7305
Z 13Oct2022 07Nov2022 8 1 2403
Z 09Feb2023 30Jun2023 12 2 5149
AA 08Sep2022 04Oct2022 8 1 2746
BB 01Jul2022 26Apr2023 2 1 10501
CC 09Aug2022 19Jun2023 12 1 1373
DD 01Jul2022 21Aug2022 10 1 9588
DD 17Oct2022 13Jun2023 11 2 5935
EE 01Jul2022 15Jul2022 5 1 3196
EE 26Jul2022 17Aug2022 5 2 7305
EE 23Sep2022 19Feb2023 4 3 13697
;;;
run;
Here are the results from the above example:
Clinic
Count
Cost
3
1
$9,588
4
1
$13,697
5
1
$10,501
8
1
$2,403
10
1
$9,588
11
1
$5,935
12
2
$12,358
Grand Total
8
$64,070
... View more