Creating an AI Assistant for SAS Viya in 5 steps (@sassoftware/viya-assistantjs) - Part I
Recent Library Articles
Recently in the SAS Community Library: SAS' @kumardeva debunks the myth that developing AI assistants is too hard. He shows you how to use the @sassoftware/viya-assistantjs library to jump start your development.
Clinical trial publications frequently allocate at least one of the allotted tables to summarize the demographics, stratification factors, and other variables of interest of the patients involved with the study. These tables generally include basic distribution information such as frequencies, means, medians, and ranges while also comparing these distributions across a key factor, such as treatment arm, to determine whether there was any imbalance in patient populations when doing analysis. These distributions are not difficult to compute and combine into a table, but as treatments become more specific to patient characteristics such as genetic biomarkers and tumor stages there is a need to be able to display the distributions in subgroups. The macro %TABLEN is a tool developed to compute distribution statistics for continuous variables, date variables, discrete variables, univariate survival time-to-event variables, and univariate logistic regression variables and combine them into a table for publication. %TABLEN has multiple features for comparisons, subgrouping, and outputting to multiple destinations such as RTF and PDF. The macro %TABLEN is a valuable tool for any programmer summarizing patient level data.
... View more
Hi there, I have a quick question about manipulating a dataset in SAS. I have included a sample dataset below. Date Country Weekly Cases 2021-08-09 United States 500 2021-08-10 United States 0 2021-08-11 United States 0 2021-08-12 United States 0 2021-08-13 United States 0 2021-08-14 United States 0 2021-08-15 United States 325 2021-08-16 United States 0 2021-08-17 United States 0 2021-08-18 United States 0 2021-08-19 United States 0 2021-08-20 United States 0 2021-08-21 United States 0 2021-08-10 United Kingdom 100 2021-08-11 United Kingdom 0 2021-08-12 United Kingdom 0 2021-08-13 United Kingdom 0 2021-08-14 United Kingdom 0 2021-08-15 United Kingdom 0 2021-08-16 United Kingdom 400 2021-08-17 United Kingdom 0 2021-08-18 United Kingdom 0 2021-08-19 United Kingdom 0 2021-08-20 United Kingdom 0 2021-08-21 United Kingdom 0 What I am trying to do is report the number of cases by week for each country in my dataset. However, what I noticed is that countries did not always report on the same day of the week. I was wondering if there was a way for me to manipulate the data so that I could divide the weekly count into daily counts (important to note that a weekly count might not always represent a 7 day reporting week, in my example below the first weekly count for US represent 6 days and the 2nd weekly count represents 7 days). Ideally every time a weekly count is presented for each country, I would like that number to be divided equally until the next weekly count is present for that country. I have included what I would like my data to look like instead. Date Country Weekly Cases Daily Cases 2021-08-09 United States 500 83.3 2021-08-10 United States 0 83.3 2021-08-11 United States 0 83.3 2021-08-12 United States 0 83.3 2021-08-13 United States 0 83.3 2021-08-14 United States 0 83.3 2021-08-15 United States 325 46.4 2021-08-16 United States 0 46.4 2021-08-17 United States 0 46.4 2021-08-18 United States 0 46.4 2021-08-19 United States 0 46.4 2021-08-20 United States 0 46.4 2021-08-21 United States 0 46.4 2021-08-10 United Kingdom 100 16.7 2021-08-11 United Kingdom 0 16.7 2021-08-12 United Kingdom 0 16.7 2021-08-13 United Kingdom 0 16.7 2021-08-14 United Kingdom 0 16.7 2021-08-15 United Kingdom 0 16.7 2021-08-16 United Kingdom 400 66.7 2021-08-17 United Kingdom 0 66.7 2021-08-18 United Kingdom 0 66.7 2021-08-19 United Kingdom 0 66.7 2021-08-20 United Kingdom 0 66.7 2021-08-21 United Kingdom 0 66.7 I have a pretty large dataset (400k observations) with 230 unique countries that span a few years. Again the countries did not always report their weekly count on the same day, and the weekly counts don't always represent a 7 day count. If there is a way I can easily manipulate the dataset to do the above daily count, I would really appreciate it! Thank you so much for any advice that you can provide!
... View more
Hello, I am trying to create a table using PROC SQL and I want to join on a second table. Without giving the actual column names, the code is essentially this. proc sql; create table TABLE as select distinct col1, col2, ..., case when b.columnX is null then 'Y' else 'N' as columnXNull from TABLE1 a left join TABLE2 b on strip(put(a.columnX,30.)) = b.columnX ;quit; In TABLE1 columnX is Type: Numeric, Length: 8 In TABLE2 columnX is Type: Character, Length: 30 I am getting 2 errors in this code - ERROR: Expression using equals (=) has components that are of different data types. ERROR: Function STRIP requires a character expression as argument 1. I originally did not have the put function and was still receiving the above errors, except the second error appeared twice. Since adding the put(), one of the two errors for function strip are gone. However, I am confused, because after reading other forum posts, the put() function should be changing columnX to a character. Am I missing something or doing something wrong?
... View more
Hi everybody! I would like to create an additional variable that is the average of my duplicate target levels with my main target levels. I don’t want the 0’s to average with another sample though. For example on May 6, located at EU, there are two levels for the N.GIII target…I’d like to average those together, but on May 20, located at HU, the duplicate sample is a non-zero, I don’t want to average that value, with the zero in the main sample. Any guidance would be appreciated!
... View more
Hello, everyone. I am using SAS Data Integration Studio - delete transformation. This is my work flow: source table(Table A) --> extract(Temp Table B) --> delete --> destination table(Table C) First, I extract a field from the source table and suppose it will only yield one result, say id = 2. Second, I make a setting (where clause) in the delete transformation block, C.id = B.id (which is 2 from Table A) However, it always yields a result that ERROR: Expression using equals (=) has components that are of different data types. I have checked the setting of both id of both table, also the temp table on extract transformation, in SAS, they are the same. Meanwhile, I have checked the setting of both id of both table in Database, they are also the same. Could anyone suggest the problem for me? Thankyou
... View more