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.
i found an old post in link below : my code: data set1; set sashelp.baseball ; run; proc sort; by team ; run; ods excel file="C:\Users\test.xlsx" options(sheet_interval='BYGROUP' sheet_interval='BYGROUP' sheet_name= '#byval1' ); proc print data=set1; by team; run; ods excel close; Solved: export multiple data sets into multiple sheets in excel - SAS Support Communities the problem is that row 1 has title and row 2 is empty. how to remove row 1 and 2 to make it looks like excel , not report. also for column Obs, is there any possible to delete or use other variable to instead? thanks.
... View more
Hello, I am trying to figure out how to expand a dataset by creating a new row for each year between a start date and end date and find the age the person is at each year between those 2 dates. I have tried a couple of things without success. I have tried to modify this code: https://stackoverflow.com/questions/47428867/how-to-create-additional-rows-for-each-day-between-two-dates-in-sas.Though the code ran successfully without errors, I did not get the intended results. It incremented the first observation's start date, and I need the first observation's start date to remain unchanged. I am not certain how to proceed. Any assistance would be appreciated. I am using SAS9.4.
... View more
hello. I am a SAS beginner. I have an experimental group, and I need to build a control group. A control group must be created by matching control group subjects 1:1 based on two variables: age and sex of the experimental group. Matching should be done using only those two variables, not the propensity score. Should I use proc psmatch or inner join? I would appreciate it if you could provide detailed code.
... View more
Hi there,
I am trying to create a csv file that has both the variable names of the dataset and another line as the header. It should look like below.
I have tried proc export, ods csvall, and a data _null_ statement but can't seem to get it to work. Examples of my code below. Is there a way to add in the ndar_subject line header while keeping the variable names as the headers below? If I could get the variable names as a header in the data _null_ step that would be ideal, but I have not been able to figure this out.
%let header1 = %str(ndar_subject,1);
%put &header1; data _null_; file "R:\tsanche\REALM Data\Data\SAS Created Data\Data Repository\July 2024 CSV Upload Files\REALM Subject and Pedigree July 2024.csv" dsd; set repdata.pedig;
if _n_ = 1 then do; put "&header1"; end;
put (_all_)(+0); run;
proc export data=repdata.pedig outfile='R:\tsanche\REALM Data\Data\SAS Created Data\Data Repository\July 2024 CSV Upload Files\REALM Subject and Pedigree July 2024.csv' dbms=csv replace; run;
ods csvall file="R:\tsanche\REALM Data\Data\SAS Created Data\Data Repository\July 2024 CSV Upload Files\REALM Subject and Pedigree July 2024.csv"; proc report data=repdata.pedig; run; ods csvall close;
Thanks in advance!
... View more
Hi. I'm working with doses of limestone and styding soil pH. My model is a quadratic polynomial and I did a scatterplot in PROC SGPLOT. But I want to know if I can put the equation inside of the graph. How can I do that? I know how to do in Excell, but in the SAS on Demand I don't know if it's possible. Below is the code line that I used. Thanks for the helpful. proc sgplot data=mydata noautolegend; title height=11pt color=black "soil pH vs limestone"; scatter Y=pH X=DOSE; yaxis label="pH"; xaxis min=0 max=1.92 values=(0 0.48 0.96 1.44 1.92) label="Limestone (t/ha)"; REG Y=pH X=DOSE/degree=2; keylegend / location=inside position=top across=5 down=3 titleattrs=(wight=bold size=9pt) valueattrs=(collor=black size=7pt); run;
... View more