Skip to content
Advertisement

Tag: sas

SAS EG append new data and overwrite already existing rows

My goal is to update this table called DAGLIGEKORREKTIONER_lib_xlsx: Here i a sample of my data. Don’t mind the cmd prompt it is only to cover sensitive data. I then have a table with a similar structure called DAGLIGEKORREKTIONER: But how do I append the table DAGLIGEKORREKTIONER_lib_xlsx with DAGLIGEKORREKTIONER. And if DAGLIGEKORREKTIONER_lib_xlsx contains rows with the same “approval_text” as DAGLIGEKORREKTIONER

Group SAS rows based on conditions

I am new to SAS community and need your help for one of my analysis. I have a table like below: ID VAR Group Breach Month 1 A 1 202001 2 A 1 202002 3 A 1 202003 4 A 1 202004 5 A 1 202005 6 A 1 202006 7 A 0 202007 8 A 1 202008 9 A

Selecting the maximum date before a certain year

I have a table where I’d like to select only the record with the maximum date: The issue is that I have some IDs in the table where the maximum date is in 2022, so that is what gets selected. How do I select the maximum date for a record that is before 01JAN2022 so that my output look like

counting consecutive months in sas

From the sample data below, I’m trying to count how many consecutive months a member has. In the event if an ID has a gap month in the middle, the output should show the most recent count of consecutive months this member had, see example below. dataset=one ID Month 72 01SEP2020 72 01OCT2020 72 01NOV2020 72 01DEC2020 72 01FEB2021 72

SAS – Group By not working due to case statement in Select

I have an issue where some SAS code using PROC SQL isn’t working as there is a case statement around one of my calculations. The code looks like the below: This code returns duplicated rows for the number of rows in table A. Removing the case statement as below: This just returns the group by using the levels of var1,var2

Advertisement