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 I am new to proc template . 1. I am displaying bar value at the top of bar using barlabel=true. How to display the value at the center of the bar instead of top? 2. Also, how to wrap x axis value. text variable have one value very long 3. what option in proc template i can use to display P value at the top. Thanks in advance
... View more
Hi all,
Please help me to code this. This is the dataset below-
I have 2 drugs being used for each ID i.e., SGA and DM. I have multiple start date and end dates for each ID and drug. I want to see if the DM_start falls into any of the SGA_start and SGA_end under each id. That is DM_start of period 3 can fall in the SGA_start and SGA_end of period1.
And also calculate the number of overlapping days for each time period. I want to know the no. of days for each orange period.
Thank you all in advance,
Any help would be appreciated.
... View more
Howdy!
If I specify a font size in SGPLOT, SAS does not seem to actually produce that font size in ODS PDF. It seems to produce some larger font size. Here's example code.
ods pdf file = "M:\test.pdf";
ods graphics on / reset;
title1 height = 12pt font = 'Arial' 'Title 1';
title2 height = 11pt font = 'Arial' 'Title 2';
title3 height = 10pt font = 'Arial' bold 'Title 3';
footnote1 height = 9pt font = 'Arial' 'Footnote 1';
footnote3 height = 8pt font = 'Arial' 'Footnote 2';
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 9.5pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 10pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 10.5pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 11pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 11.5pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 12pt); run;
ods pdf close;
Title1 comes out as 13 pt. Title2 as 11.5 pt.
Title3 as 11 pt.
Footnote1 as 9.5 pt.
Footnote2 as 9 pt.
The x-axis tick values come out as 9.5, 11, 11, 11.5, 11.5, and 13 pt. respectively.
If I add noGTitle and noGFootnote to the ODS PDF statement, then the font sizes for the titles and footnotes are correct. It seems the problem is with the graphic procedure itself.
I checked the font sizes by copying the text from the PDF and pasting into Word. I am fairly certain the same happens with ODS RTF; I can't paste the text into Word, but eyeballing it, it looks the same. Attached are the PDF and RTF outputs each way, plus a screenshot of the side-by-side comparison of the two RTF files showing that the font without noGTitle definitely is bigger than the font with noGTitle.
Does anyone else also get this? I tested on a SAS session with no other options, custom configuations, etc. but maybe there's still something set on my machine that is messing it up.
Best regards,
Michael
... View more
Hi, I'm trying to create a table like this: From this output: I only want to keep the values where both variable have a value of 1. The above output was created using the following code: Proc surveyfreq data=work.ocd;
table dsm_OCD*(Contamination_OC Harming_OC Ordering_OC Hoarding_OC Sex_rel_mor_OC Any_OC One_OC Two_OC Three_OC Four_OC Five_OC)/nowt;
weight finalp2wt;
run;
... View more