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.
There are two things I want (1) header font to be Times New Roman and (2) to remove the "dosegrp2=" part of the header. How can I achieve this?
Less important, but is there a way to have a singular y-axis label and x-axis label?
I didn't use PROC SGPANEL b/c I wanted a separate legend for each treatment group.
ods graphics / border= off;
ods layout gridded columns= 3 advance= table;
proc sgplot data= sadpk;
by dosegrp2;
series x= t y= C / group= usubjid markers;
xaxis label= "Time (h)" labelattrs= (family= "&ffamily." size= &fsize. weight= bold)
values= (0 0.5 1 2 4 6 8 12) valueattrs= (family= "&ffamily." size= &fsize.)
offsetmax= 0.1;
yaxis label= "Concentration in Plasma (ng/mL)" labelattrs= (family= "&ffamily." size= &fsize. weight= bold);
keylegend / title= " " titleattrs= (family= "&ffamily." size= &fsize. weight= bold)
across= 1 noborder position= topright location= inside;
run;
ods layout end;
... View more
I have an interesting challenge with TEMPLATE. I am trying to create a lattice where each plot within the lattice is a panel of graphs. For a single panel of graphs, I can easily do this with SGPANEL, but I need to make a single figure with several different panels. The following TEMPLATE code works just fine to create a 1x4 panel of graphs (instead of using SGPANEL):
proc template;
define statgraph test12;
begingraph;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg limitlower=lclmarg ;
seriesplot x=year y=y / lineattrs=graphFit ;
scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
endlayout;
endgraph;
end;
run;
I would like to wrap the equivalent of a "LAYOUT LATTICE" around this to have several rows, where each row is a panel of four (or whatever) graphs (with a different response variable for each row). I realize that LAYOUT LATTICE does not allow for DATAPANEL, so I am looking for a workaround. For instance, I would like to use something like:
proc template;
define statgraph test12;
begingraph;
layout lattice / columns=1 rows=3;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg limitlower=lclmarg ;
seriesplot x=year y=p / lineattrs=graphFit ;
scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg2 limitlower=lclmarg2 ;
seriesplot x=year y=p2 / lineattrs=graphFit ;
scatterplot x=year y=y2 / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
endlayout;
....
endlayout;
endgraph;
end;
run;
Any recommendations on how to do this? Thanks.
LVM
... View more
An update is available for SAS Viya 3.4.
Published 20May2024
Issue(s) addressed:
SAS Note 70799: 'ERROR: Could not create sasenv.cfg...' occurs when trying to deploy a SAS® Embedded Process for Greenplum version 7
For a complete list of SAS Viya updates available, visit the SAS Viya Updates Page.
... 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
I have a dataset where the same sample ID is associated with two components (a and b), it also contains singular data (c). I'm trying to add a column that counts the number of occurrences of the ID so I can identify when I only have one of the two components. I'm trying to create the Count column in the table below so I could identify the unpaired component (in red text) using an if then statement (if Comp eq "a" and Count ne 2 then) and (if Comp eq "b" and Count ne 2 then). Comp ID Count c 5236 1 a 3298 2 b 3298 2 a 4172 1 a 8723 2 b 8723 2 c 7692 1 If it were in Excel, it could be done using the COUNTIF function and dragging it down (=COUNTIF(B:B,B2)) Unfortunately I don't even know where to begin to do this in SAS and haven't had any luck Googling it. I would appreciate any direction you could give me.
... View more