07-03-2024
OlsabeckT29
Fluorite | Level 6
Member since
02-22-2022
- 9 Posts
- 5 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by OlsabeckT29
Subject Views Posted 761 06-26-2024 09:37 AM 814 06-26-2024 07:59 AM 574 12-18-2023 08:59 AM 1532 05-30-2023 07:47 AM 1174 01-17-2023 10:14 AM 698 11-01-2022 01:11 PM 1309 10-06-2022 10:07 AM 1462 06-28-2022 12:45 PM 1508 06-28-2022 11:31 AM -
Activity Feed for OlsabeckT29
- Posted Re: Calculate difference between several variables on SAS Enterprise Guide. 06-26-2024 09:37 AM
- Posted Calculate difference between several variables on SAS Enterprise Guide. 06-26-2024 07:59 AM
- Posted Reclassifying Categorical data within a Group on SAS Programming. 12-18-2023 08:59 AM
- Posted Output a group if conditional statement is met on SAS Programming. 05-30-2023 07:47 AM
- Liked Re: Conditional statements and grouping observations for FreelanceReinh. 01-18-2023 07:58 AM
- Posted Conditional statements and grouping observations on SAS Programming. 01-17-2023 10:14 AM
- Liked Re: Converting date formats in in Sysfunc for PaigeMiller. 11-01-2022 01:34 PM
- Posted Converting date formats in in Sysfunc on SAS Programming. 11-01-2022 01:11 PM
- Liked Re: Convert Lat/Long to Census Tract for ballardw. 10-14-2022 03:37 PM
- Posted Convert Lat/Long to Census Tract on SAS Procedures. 10-06-2022 10:07 AM
- Liked Re: Large Dataset Long to Wide for Tom. 06-30-2022 08:25 AM
- Liked Re: Large Dataset Long to Wide for pink_poodle. 06-28-2022 12:46 PM
- Posted Re: Large Dataset Long to Wide on SAS Programming. 06-28-2022 12:45 PM
- Posted Large Dataset Long to Wide on SAS Programming. 06-28-2022 11:31 AM
-
Posts I Liked
Subject Likes Author Latest Post 2 1 1 1 1
06-26-2024
09:37 AM
No, we are only looking at the difference between two years.
... View more
06-26-2024
07:59 AM
Hello, I am trying to calculate the difference between the data observed in 2023 and 2024 by month. I have a total of 84 observations and need to calculate the difference between all 12 months. Below is a sample of how the data is formatted. data Have;
input id 23Jan 23Feb 23Mar 24Jan 24Feb 24Mar;
datalines;
1 0.54 0.54 0.52 0.62 0.61 0.60
2 0.48 0.45 0.48 0.71 0.68 0.67
3 0.59 0.61 0.59 0.57 0.54 0.58
4 0.61 0.62 0.59 0.62 0.61 0.54
; I want a dataset that contains the difference for each month for all 84 observations. Data Want;
ID JanDiff FebDiff MarDiff
1
2
3
4 I know I can write out all 12 calculations but is their a more efficient coding strategy to calculate the differences? Thanks in advance
... View more
12-18-2023
08:59 AM
I have a long dataset of over a million records of people with their race category. Some people have more than one race assigned to their person id. What I want to do is select the best race for each person id. In the dataset some people will have an observation that says unknown or other and also actual race category, I want to get rid of the unknown/other observation and keep the more descriptive race category. Some people will also have different races listed. For example person A will have one observation that says black and one observation that says white. For those I want to be able to assign that person's race to be multiracial. I was trying to do this using a Do Until statement but it is not outputting what I want. proc sort data=race_check3; ; by child_id; run;
Data race_check4;
Do until (last.child_id);
set race_check3;
by child_id;
if (race_eth NE 'Unknown') then race_eth2=race_eth;
end;
run; Data have: Child_id Race_eth 16849918029 NH Asian/Native Hawaiian/Other Pacific Islands 16849918029 NH White 16850191831 NH White 16850191831 Unknown 16850404097 NH Asian/Native Hawaiian/Other Pacific Islands 16850404097 Unknown 16850502704 NH Asian/Native Hawaiian/Other Pacific Islands 16850502704 NH White 16850783900 Other 16850783900 Unknown 16850922663 NH Asian/Native Hawaiian/Other Pacific Islands 16850922663 Unknown 16851203403 NH Asian/Native Hawaiian/Other Pacific Islands 16851203403 NH White 16851234942 NH White 16851234942 Unknown Data Want Child_id Race_eth 16849918029 Multi Racial 16850191831 NH White 16850404097 NH Asian/Native Hawaiian/Other Pacific Islands 16850502704 Multi Racial 16850783900 Other 16850922663 NH Asian/Native Hawaiian/Other Pacific Islands 16851203403 Multi Racial 16851234942 NH White
... View more
05-30-2023
07:47 AM
Hello, I have a dataset of 18 million records. There are repeating person ids. I need this dataset split into two separate datasets. One dataset should be for a person who has ever had mx = NVX. The other data set would be for everyone else. Have: Obs person_id MX
1 10000103722 PFR
2 10000103722 PFR
3 10000181132 NVX
4 10000181132 MOD
5 10000189649 PFR
6 10000189649 PFR
7 10000189649 NVX
8 10000189649 PFR
9 10000371289 PFR
10 10000371289 PFR
11 10000751831 NVX
12 10000810473 MOD
13 10000810473 MOD
14 10000829168 JSN
15 10000864651 PFR
16 10000864651 PFR
17 10000865007 PFR
18 10000865007 NVX
19 10000865500 PFR
20 10000865500 PFR
21 10000865883 MOD
22 10000865883 MOD
23 10000866093 PFR
24 10000866093 NVX
25 10000866093 NVX Want: Obs person_id MX
3 10000181132 NVX
4 10000181132 MOD
5 10000189649 PFR
6 10000189649 PFR
7 10000189649 NVX
11 10000751831 NVX
17 10000865007 PFR
18 10000865007 NVX
23 10000866093 PFR
24 10000866093 NVX
25 10000866093 NVX I used the below code to try and do this, but it is only outputting records when mx=NVX and not outputting the entire group when NVX is found. Data admin_adult2 admin_nvx;
Set admin_adult;
By person_id;
if mx IN ('NVX') then output admin_nvx;
Else output admin_adult2;
Run;
... View more
01-17-2023
10:14 AM
Hello, I have a list of pneumococcal vaccination administrations (n=2,400,000) and am trying to determine the best way to indicate if each person has met the criteria to be considered complete. The dataset is vertical. I have unique identifiers for each person and if that person has received more than one vaccination then they will have multiple observations listed. To be complete the person will need to meet one of these criteria: PCV15 + PPSV23 PCV20 PPSV23 + PCV15 PPSV23 + PCV20 PCV13 + PPSV23 PCV13 + PCV20 What would be the most efficient way to handle marking individuals as complete? Below is an example using dummy data of what I have vs what I want. HAVE: ID Vaccine 1 PCV15 1 PCV13 1 PPSV23 2 PCV13 2 PPSV23 3 PCV20 4 PPSV23 4 PCV15 5 PCV13 WANT (where 1 = complete and 0 = incomplete) ID Pneumo Complete 1 1 2 1 3 1 4 1 5 0 Thank you
... View more
11-01-2022
01:11 PM
I am working to automate a piece of code. When I save my sas dataset I need to have the date the data was last refreshed attached to the end of the file name. Instead of changing the code every week to the new date I would rather just have it be automated. Here is what I have: proc sql;
select max(date_created) as maxaddressdt
into :refresh separated by ""
from mcir.new_address;
quit; %put &refresh; */System returns 29OCT2022:05:45:08*/; This returns the last refresh date in a date time format. I would like my file name to read as ARCHRP_20221029 for file organization purposes. Below is what I tried to reformat the date time variable to be yymmddn8. The log gave the warning that Argument 2 is out of range. %let refreshfmt=%sysfunc(putc(&refresh,yymmddn8),8.) ;
%put &refreshfmt;
libname rawdata 'c:\data';
%macro saveloc(date=);
data rawdata.ArchRP&date (compress=binary);
set rp;
run;
%mend saveloc;
%saveloc(date=&refreshfmt);
Thanks for the help
... View more
10-06-2022
10:07 AM
My dataset already has been geocoded but it is missing census tract information. Is there a way in SAS to identify the corresponding census tracts to the existing lat/longs without running the whole dataset through proc geocode? The dataset has about 15 million observations so to re-geocode it will take significant time. I am trying to avoid using the following piece of code due to the time it will take for this size of dataset. Proc geocode
method=street
data=child_clean
out=georesults
lookupstreet=lookup.usm
attribute_var=(tract);
run; Thank you for your help!
... View more
06-28-2022
12:45 PM
The dataset I have in sas is read through an oracle connection and has millions of observations. I just type it into the question to provide an example of what I am working with. This dataset is used to generate a dashboard in Power BI so the end result is an exported txt file. The dashboard shows vaccine coverage rates. It needs to be a person level dataset, not a shot level dataset to do this.
... View more
06-28-2022
11:31 AM
Hello, I am working with a long dataset of about 15 million records that currently is listing out the vaccine details for each shot a person received. I need to get this dataset into a wide dataset. I have 9 variables that need to be transposed and would rather not do 9 proc transpose steps with this large of a dataset. I have recip_id as my by variable and Dose1 is what I need to transpose on. Dose1 ranges from 1-13. Is there a more efficient way to get what I need? I am running SAS 9.4 Below is an example of what I have vs what I want: data have; input recip_id Dose1 admin_date CVX MC Auth Lot_id dose_num vax_fund admin_state interval Datalines; 1 1 10/16/2021 208 PF US acvds 1 k MI . 1 2 11/6/2021 208 PF US bdsa 2 k MI 21 1 3 5/29/2021 207 MO US bde1de 3 k MI 90 2 1 6/7/2021 207 MO US 2ds42 1 h OH . 3 1 7/7/2021 208 PF US 3fs1 1 h WI . 3 2 7/7/2021 208 PF US fews2 2 k WI 28 3 3 8/4/2021 208 PF US gesw21 3 k WI 87 4 1 1/21/2022 208 PF US fewq21 1 h NY . 4 2 12/22/2020 208 PF US gresa21 2 h NY 28 5 1 1/12/2021 212 JS US gewa2 1 k WV . 6 1 4/12/2021 207 MO US fewqa2 1 k IN . 6 2 4/29/2021 207 MO US gewad2 2 k IN 27 Want recip_id Dose1 admin_date1 CVX1 MC1 Auth Lot_id1 dose_num1 vax_fund1 admin_state1 interval1 admin_date2 CVX2 MC2 Auth2 Lot_id2 dose_num2 vax_fund2 admin_state2 interval2 admin_date3 CVX3 MC3 Auth3 Lot_id3 dose_num3 vax_fund3 admin_state3 interval3 1 1 10/16/2021 208 PF US acvds 1 k MI . 11/6/2021 208 PF US bdsa 2 k MI 21 5/29/2021 207 MO US bde1de 3 k MI 90 2 1 6/7/2021 207 MO US 2ds42 1 h OH . 3 1 7/7/2021 208 PF US 3fs1 1 h WI . 7/7/2021 208 PF US fews2 2 k WI 28 8/4/2021 208 PF US gesw21 3 k WI 87 4 1 1/21/2022 208 PF US fewq21 1 h NY . 12/22/2020 208 PF US gresa21 2 h NY 28 5 1 1/12/2021 212 JS US gewa2 1 k WV . 6 1 4/12/2021 207 MO US fewqa2 1 k IN . 4/29/2021 207 MO US gewad2 2 k IN 27
... View more