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.
Hi All,
Could anyone help me with the below requirement?
I have 3 variables SUBJ CODE TRT which have values as following.
SUBJ CODE TRT
1001 AB A
1001 AB B
1002 CD C
1002 CD C
1003 EF E
1003 EF F
In the above data for each SUBJ there is a specific code which have corresponding TRT vales as A and B. Example, for SUBJ 1001, code is AB and TRT is having 2 records for same SUBJ and CODE with A in 1 row and B in next row. If it is 1002 then the 2 TRT records should be C and D, but if it C and C then it should be flagged. See below expectation.
SUBJ CODE TRT FLAG
1001 AB A 0
1001 AB B 0
1002 CD C 0
1002 CD C 1
1003 EF E 0
1003 EF F 0
1004 AD A 0
1004 AD A 1
Can anyone help me achieve this?
... View more
Hi, do you guys ever work with Verhoeff check digit algorithm (https://en.wikipedia.org/wiki/Verhoeff_algorithm) with SAS? I am trying to use sas for verhoeff check digit but havent found any script to do so.
... View more
Watch this Ask the Expert session to learn the flexibility, efficiency and scalability of combining SAS Event Stream Processing with ONNX Runtime and Microsoft Azure, addressing common challenges in AI model deployment and execution.
Watch the webinar
You will learn to:
Streamline AI project workflows by integrating SAS Event Stream Processing with ONNX Runtime and Microsoft Azure.
Integrate ONNX Runtime with SAS Event Stream Processing to create real-time streaming analytics with simplified testing and deployment on a variety of hardware alignments.
Jump-start projects with sample projects and code examples on GitHub to deploy ONNX models efficiently and effectively.
The questions from the Q&A segment held at the end of the webinar are listed below and the slides from the webinar are attached.
Q&A
What use cases does this solution provide the most value for?
This question is not easy to answer because there are so many use cases. This presentation was just a selection of a few, but I think it’s particularly useful in computer vision. For example, if you need to not only identify objects but also apply further logic and scale up, this solution can handle multiple cameras across that location. We also have use cases with deployments in multiple different geographic locations, allowing us to manage several factories—about 40 factories with hundreds of cameras each—centrally. This flexibility lets you define your specific needs, because no two businesses are the same.
For instance, in some scenarios, we need to identify vehicles in specific factory spaces, while in others, we need to alert workers' safety. Worker safety is a particularly interesting use case with significant implications for improving employee habits and ensuring a safer workspace. This solution helps to easily spot unsafe behaviors and can be quickly customized for the specific needs of different factories.
For example, we have LOTO (lockout-tagout) deployments that verify the dangerous equipment is properly shut off and not able to be started again prior to completion of the task. We receive sensor feedback from the machinery, so we know if the system is verified safe, or if the conveyor belt is moving. And the best part is, all this is possible without needing to change your existing infrastructure. You can use what is already in place, and this solution complements and enhances your current setup, allowing you to apply the necessary logic.
How can I learn more?
We highly recommend reaching out via email to iotcontact@sas.com. This way, you can get a trial license and use the Azure Marketplace as a very easy way to deploy SAS Event Stream Processing and experiment with it. You'll find a comprehensive list of examples available for download at the welcome screen, covering various use cases such as computer vision object detection.
For further examples, you can refer to our GitHub repository, where you can easily get the code. We also have an online community where you can ask questions and get direct feedback from developers. All these links are on the slide deck provided. We’re very welcoming and happy to assist you.
Recommended Resources
SAS Event Stream Processing Homepage
About SAS
ONNX runtime
Microsoft Azure
Please see additional resources in the attached slide deck.
Want more tips? Be sure to subscribe to the Ask the Expert board to receive follow up Q&A, slides and recordings from other SAS Ask the Expert webinars.
... View more
Hi,
I took the SAS 9.4 Base Certification practice exam. Below are the steps for question 13.
This project will use data set cert.input36. At any time, you may save your program as program36 in cert\programs. Write a SAS program that will clean the data in cert.input36 as follows:
Step 1:
create a temporary data set, cleandata36.
In this data set, convert all group values to upper case.
Then keep only observations with group equal to 'A' or 'B'.
Step 2:
Determine the MEDIAN value for the Kilograms variable for each group (A,B) in the cleandata36 data set. Round MEDIAN to the nearest whole number.
Step 3:
create results.output36 from cleandata36
Ensure that all values for variable Kilograms are between 40 and 200, inclusively.
If the value is missing or out of range, replace the value with the MEDIAN Kilograms value for the respective group (A,B) calculated in step 2.
How many observations are in results.output36?
The original dataset had 5000 observations.
My answer was 4897 observations.
The practice exam has 4992 observations for the answer.
I can't figure out why there is a 95 observation difference.
I did answer the second question regarding the median correctly.
Thanks for your help.
I used the following code:
data cleandata36; set cert.input36; group = upcase(group); where group in ('A' 'B'); run;
proc means data=cleandata36 median maxdec=0; class group; var kilograms; run;
data results.output36; set cleandata36; if Group = 'A' and kilograms lt 40 or kilograms gt 200 then kilograms = 79; if Group = 'B' and kilograms lt 40 or kilograms gt 200 then kilograms = 89; run;
proc means data=results.output36 maxdec= 2 min max mean median n; class group; var kilograms; run;
The answer code is: data work.cleandata36; set cert.input36; group=upcase(group); if group in ('A','B'); run;
proc means data=work.cleandata36 median;
class group;
var kilograms;
run;
data results.output36;
set cleandata36;
if Kilograms < 40 or Kilograms > 200 then do;
if group='A' then kilograms=79;
else kilograms=89;
end;
run;
proc contents data=results.output36;
... View more
Hi, I have data like below and I would like to convert variables as test with their result. I have created macro and calling a macro for every variable each time. But the problem is I have more than 4,00,000 records with 100 variables which means 100 tests, so it is taking lot of time for each test and when I am stacking them then I am getting low space pop up notification, and I am unable to run my program completely. Is there any solution for this? data I have: data have;
input Obs $1-2 id $3-7 DT $8-17 var6_d0 $18-20 var20 $21-23 var30 $24-26 var40 $27-29 var70 $30-32 var6_d1 $33-35 var21 $36-38 var31 $39-41 var41 $42-44 var71 $45-47;
datalines;
1 1001 23MAY2023 No
2 1001 23MAY2023 No
3 1001 23MAY2023
4 1001 23MAY2023
1 1001 23MAY2023
2 1001 23MAY2023
3 1001 23MAY2023
4 1001 23MAY2023
1 1001 23MAY2023
2 1001 23MAY2023
3 1001 23MAY2023
4 1001 23MAY2023
1 1001 23MAY2023
2 1001 23MAY2023
3 1001 23MAY2023
4 1001 23MAY2023
1 1001 23MAY2023
2 1001 23MAY2023
3 1001 23MAY2023
4 1001 23MAY2023
1 1001 20JUN2023 No
2 1001 20JUN2023 No
3 1001 20JUN2023
4 1001 20JUN2023
1 1001 20JUN2023
2 1001 20JUN2023
3 1001 20JUN2023
4 1001 20JUN2023
1 1001 20JUN2023
2 1001 20JUN2023
3 1001 20JUN2023
4 1001 20JUN2023
1 1001 20JUN2023
2 1001 20JUN2023
3 1001 20JUN2023
4 1001 20JUN2023
1 1001 20JUN2023
2 1001 20JUN2023
3 1001 20JUN2023
4 1001 20JUN2023
1 1001 15AUG2023 No
2 1001 15AUG2023 No
3 1001 15AUG2023
4 1001 15AUG2023
1 1001 15AUG2023
2 1001 15AUG2023
3 1001 15AUG2023
4 1001 15AUG2023
1 1001 15AUG2023
2 1001 15AUG2023
;
run; Macro I have created: %macro convert_variables_columns(test=);
data want;
set have;
where &test. ne "";
test=&test.;
res=&test.;
run;
proc sort; by id; run;
%mend;
%convert_variables_columns(test=var6_d0);
%convert_variables_columns(test=var20);
%convert_variables_columns(test=var30);
%convert_variables_columns(test=var40);
%convert_variables_columns(test=var70);
%convert_variables_columns(test=var6_d1);
%convert_variables_columns(test=var21);
%convert_variables_columns(test=var31);
%convert_variables_columns(test=var41);
%convert_variables_columns(test=var71); Data I want: data want;
input obs $1-2 id $3-7 dt $8-17 test $18-25 res $26-28;
datalines;
1 1001 23MAY2023 var6_d0 No
2 1001 23MAY2023 var40 No
1 1001 20JUN2023 var6_d0 No
2 1001 20JUN2023 var40 No
1 1001 15AUG2023 var6_d0 No
2 1001 15AUG2023 var40 No
;
;
run; Thanks, Chi
... View more