I have the table ‘Table01’ which contains the keys that should be mandatory: id 1 2 3 4 And I also have the table ‘Table02’ which contains the records to be filtered: id customer weight 1 a 100 2 a 300 3 a 200 4 a 45 1 b 20 2 b 100 3 b 17 1 c 80 4
Tag: sas
Use a macro in SAS ‘to_date’ conversion
Being forced to pass my code in explicit pass though, the date conversion no longer works. I would like to use the &aaaa macro in the convert function. My code example : I got an error : “The (full) year must be between -4713 and +9999 and be different from 0”. Does anyone have a solution? Answer Macro variables only
How to delete some observations in some groups based on a condition
I would like delete some observations in some groups based on a condition. My condition is each group : if (imput=”toto”) then delete but if a whole group has imput=”toto” then …
How to query SSMS via SAS EG ODBC connection while using data from WORK?
Is there a way to send a SAS dataset through a proc sql odbc query in SAS EG so that it can be taken in and used by SQL server? ex) SAS Data WORK.A contains 3 columns ID, col1, col2. I have a table in Sql Management Studio environment with the same ID column. I would like to (somehow) do
How to obtain summary summation when GROUP BY is not working?
I have data with the columns User_id (char) filename (char) filesize (numeric) Every user_id has more than 5 files to it’s name, of different filesize values. Problem statement: I want to have a summary of this table, with columns, User_id, Filesize, where it shows the total size occupied by each user id. It tried Group By user id, in Proc
how to delete first occurrence of each group in sas table?
I have data as follows: ID,date 1,27-08-2020 1,28-08-2020 1,30-08-2020 2,05-08-2020 3,06-08-2020 3,10-08-2020 I have to delete first occurrence for each ID group. so that data becomes ID,date 1,28-08-…
How to get observation frequency counts from multiple dataset into one table?
I have a bunch of large datasets. DS_1 (contains all unique IDs and names): DS_2: DS_3: I’m looking to create a new dataset that shows frequency counts across the datasets (and lastly calculates Total_Obs). I would output something like this: The datasets are fairly large. Is there a more efficient way to do this apart from concatenating the datasets and
concatenating large number of tables in sas
let’s assume i have a large list of tables say : all these tables have the same column names and number of columns, i want to stack all these tables one under the other in one dataset i tried to create a macro to do so (because i have multiple other lists that are larger than this but up until
Case Statement and Aggregation within a Group By classe in proc sql
I am having some trouble aggregating and using case within a group. The objective is to check Indicator for each transaction key. If ‘1’ indicator exists then we have to select the max(Change_Date). …
Group by + sum for different thresholds (preferably in a single query)
Let’s say I have a table with 3 columns: Column A: Client_ID (not unique, can appear in multiple rows) Column B: Price paid for a product Column C: Product (type) I want to get 6 columns: i.e With Client_ID x Product unique I think the first part can be achieved with a simple GROUP BY However, how can I get