Recently in the SAS Community Library: SAS' @Sundaresh1 highlights a sometimes overlooked task when applying document embeddings for purposes of similarity-based search. Normalisation of vectors helps obtain relevant matches.
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
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
Hi,
If I have a program like this that runs every month.
DATA HAVE;
INPUT CATEGORY$ TYPE MONTH ;
CARDS;
A 100 1
B 200 2
B 100 3
B 200 1
A 100 2
A 200 1
B 200 1
A 100 1
A 200 2
A 200 3
A 100 5
A 200 9
B 200 10
A 100 1
A 200 11
A 200 11
;
RUN;
PROC SQL;
CREATE TABLE INVENTORY AS
SELECT CATEGORY,
TYPE,
COUNT (CASE WHEN MONTH = 1 THEN TYPE END) AS JANUARY,
COUNT (CASE WHEN MONTH = 2 THEN TYPE END) AS FEBRUARY,
COUNT (CASE WHEN MONTH = 3 THEN TYPE END) AS MARCH,
COUNT (CASE WHEN MONTH = 4 THEN TYPE END) AS APRIL,
COUNT (CASE WHEN MONTH = 5 THEN TYPE END) AS MAY,
COUNT (CASE WHEN MONTH = 6 THEN TYPE END) AS JUNE,
COUNT (CASE WHEN MONTH = 7 THEN TYPE END) AS JULY,
COUNT (CASE WHEN MONTH = 8 THEN TYPE END) AS AUGUST,
COUNT (CASE WHEN MONTH = 9 THEN TYPE END) AS SEPTEMBER,
COUNT (CASE WHEN MONTH = 10 THEN TYPE END) AS OCTOBER,
COUNT (CASE WHEN MONTH = 11 THEN TYPE END) AS NOVEMBER,
COUNT (CASE WHEN MONTH = 12 THEN TYPE END) AS DECEMBER
FROM HAVE
GROUP BY CATEGORY, TYPE;
RUN;
But I don't want months without data to appear in the report. I want to get this:
How should I proceed ?
... View more
What a fun day for our Halifax community! The sun was shining and we were in a historic venue that was perfect for a day of learning. 😎📜
We had a presentation by @JaredLinck about R integration with SAS Viya. 👨💻👩💻
A presentation and live demonstration of how SAS and R can be used together to optimize how you work with data and analytics. We will begin with a brief overview of the various integration points between SAS and open source tools like R, Python, and web apps using APIs. This integration includes both directions of communication: from SAS out to open-source tools, and from open-source tools into SAS. We will then provide a live demonstration of specific methods for integrating R with your existing and future SAS workflows. Time will be reserved for questions and discussion of strategies and tips to take advantage of the best of both SAS and R in your daily work.
Then, we split into 3 teams and tested our SAS knowledge with a game of Jeopardy. 🎮 We found out how much we know about Procs, informats, graphs, and dates. Great job to Team No, winning in a tight race! 🏆
In this post, you will find the presentations for your reference. We hope you had fun, found it valuable, and able to reconnect with other users in the community. See you again at the next one! 🤗
... View more