Using The SAS VS Code Extension to Check Prime Distribution
Recent Library Articles
Recently in the SAS Community Library: @RyanKing showcases features in the SAS Visual Studio Code extension, including data exploration using SAS, SQL and Python in one SAS notebook file.
Hi Everyone,
I am getting below error message when trying to run below code with ENCODING=WLATIN1 from SAS Studio. Can you please suggest on it.
Note : The same code is running fine with ENCODING=UTF-8
DATA T1; var1="aábcčdď"; run;
... View more
Hi all, I have created this calculation to show the number of hours in 2024 and added it to my list table: IF ( 'Document_date_year'n = '2024'd )
RETURN (
IF ( 'Hours'n Missing )
RETURN 0
ELSE 'Hours'n )
ELSE 0 It works, but it shows the number of hours for each time a person entered their hours instead of just a count for each person. Thats why I created a crosstab instead so that it sums the total number of hours per person. But now the above calculation is not working and it just shows 0. List table output Person A 8 Person A 8 Person A 8 Person B 8 Person B 8 Person C 8 Person C 4 Desired output Person A 24 Person B 16 Person C 12 Does someone understand why this happens? Thanks in advance!
... View more
There are several methods on the internet to add multiple files into one PDF. I refer to a capable Softaken merge PDF Program to merge all PDF data into one portable document format. With the help of this utility, you can easily merge locked or unlocked PDF files. The tool merges the data of a PDF file regardless of its size. The tool permits the user to choose their own choice of PDF File for merge. Without any restrictions or limitations, you can merge your PDF file easily. This application is an attractive user-friendly interface that supports all kinds of small or big PDFs for merging. Also, using this application, you can save your merged PDF file at your desired location. This user-friendly software runs smoothly with all Microsoft Windows editions so you can easily run this utility in any Operating System. For more information, you can also download the free trial version of this software.
... View more
Dear all, I am investigating subjective stress levels during a psychosocial stress test. I ran into problems with a more complex model, and started with simplifying my model to figure out the source of the issues. I am already running into trouble by adding a quadratic term of time. My code is as follows: proc mixed data=MAST_long_VAS; class PPID Time; model BC_stress = Time Time*Time / solution residual influence; repeated Time / subject=PPID type=ar(1); run; This model runs without any problems or warnings, but does not give me the output for the fixed effect of Time*Time (only the fixed effect of Time). I tried removing "Time" from the class statement, but then I get the warning that only class variables are allowed in the repeated statement. Can anyone help me with this? Thanks in advance!
... View more
Thanks to a little math help from StackExchange, here's a SAS ODS Graphics Happy Father's Day greeting!
* Fun w/SAS ODS Graphics: Happy Father's Day! (Scatter + Polygon + Text Plots)
Star vertices algorithm from math.stackexchange.com/questions/3582342/coordinates-of-the-vertices-of-a-five-pointed-star;
data star; * Generate points for stars;
retain id 0 r1 6 r2 2.5 dad "DAD" xT 0 yT 0; * Star outer radius is 6, inner radius is 2.5;
pi=constant("pi");
do pt=1 to 600; * Points for 600 little Unicode stars;
xS=-6.25+12.5*ranuni(123); yS=-5.75+12.5*ranuni(456); output;
end;
xS=.; yS=.;
do k=0 to 4; * Points for 1 big polygon star;
x=r1*cos(2*pi*k/5+pi/2); y=r1*sin(2*pi*k/5+pi/2); output;
x=r2*cos(2*pi*k/5+pi/2+2*pi/10); y=r2*sin(2*pi*k/5+pi/2+2*pi/10); output;
end;
ods graphics / reset width=5in height=5in noborder; * Make Dad a star!;
proc sgplot noautolegend aspect=1 noborder nowall pad=0;
styleattrs backcolor=navy;
symbolchar name=uniStar char='2605'x; * Unicode value for 5-pointed star;
scatter x=xS y=yS / markerattrs=(symbol=unistar color=White size=24pt); * Plot little unicode stars;
polygon x=x y=y id=id / fill fillattrs=(color=cxd9d9d9) dataskin=crisp; * Plot big polygon star;
text x=xT y=yT text=dad / contributeoffsets=none textattrs=(size=48pt color=navy weight=bold) contributeoffsets=none; * "DAD";
xaxis display=none values=(-6.25 6.25) offsetmin=.01 offsetmax=.01; * Hide axes;
yaxis display=none values=(-5.75 6.75) offsetmin=.01 offsetmax=.01;
run;
... View more