GitHub + Jupyter Integration in SAS Viya for Learners 4 (VFL4)
Recent Library Articles
Recently in the SAS Community Library: @LGroves shows how to incorporate GitHub into your Jupyter projects in SAS Viya for Learners 4. His example should work for other, non-academic environments too!
/*Question_1 */ data k;
x=2;
if x=1 then y=100;
if x=2 then y=200;
if x=3 then y=300;
else y=27;
run; /*Question_2 */ data _n; set sashelp.class; if sex='F'; if sex='M' ; put name sex ; run;
Hi Experts,
Question_1 :Why it gives x=2 and y=27 why not y=200 in k dataset could you please explain
Question_2: Why zero observations in _n dataset
... View more
Hi All, There are both Chinese and English characters in my report. I want to use the Time New Roman font for the English characters and the SimSun font for the Chinese ones. I tried a font-face list "Times New Roman, Simsun" in my style definition. Given the Time New Roman font has no glyph for Chinese characters, I think the SimSun font will be applied for Chinese. This method is often used in CSS. But the result is not what I expected. Word processor says the Chinese characters in my report have a monospace font (等线字体) rather than SimSun. By the way, if I changed Time New Roman to Courier. It works. Courier is a kind of monospace font. Does the font type matter? Anyway, I want to know whether my idea is feasible in SAS. The following is my program sample. I program in an unicode session and both kinds of fonts have been registered in SAS. Many thanks for your help in advanced! proc template;
define style MyStyle;
parent = styles.Printer;
class fonts /
'TitleFont' = ("'Times New Roman',Simsun",10.5pt,Bold)
'TitleFont2' = ("'Times New Roman',Simsun",10.5pt,Bold)
'StrongFont' = ("'Times New Roman',Simsun",10.5pt,Bold)
'EmphasisFont' = ("'Times New Roman',Simsun",10.5pt,Italic)
'FixedEmphasisFont' = ("'Times New Roman',Simsun",10.5pt,Italic)
'FixedStrongFont' = ("'Times New Roman',Simsun",10.5pt,Bold)
'FixedHeadingFont' = ("'Times New Roman',Simsun",10.5pt,Bold)
'BatchFixedFont' = ("'Times New Roman',Simsun",10.5pt)
'FixedFont' = ("'Times New Roman',Simsun",10.5pt)
'headingEmphasisFont' = ("'Times New Roman',Simsun",10.5pt,Bold Italic )
'headingFont' = ("'Times New Roman',Simsun",10.5pt,Bold)
'docFont' = ("'Times New Roman',Simsun",10.5pt)
;
end;
run;
data test;
a = "你好, 世界";
b = "Hello, world!";
run;
options nonumber nodate;
ods rtf file="test.rtf" style=MyStyle;
proc report data=test;
run;
ods rtf close;
... View more
1. Concatenate sequence letters data catletters; input first second $3.; cards; 1 A 1 B 1 C 1 D 2 E 2 F 3 S 3 A 4 C 5 Y 6 II 6 UU 6 OO 6 N 7 G 7 H run; I want an output dataset like this: 1 "A,B,C,D" 2 "E,F" 3 "S,A" 4 "C" 5 "Y" 6 "II,UU,OO,N" 7 "G,H"
... View more
Hi, I'm brand new to the SAS environment and am trying to load/open a password protected data file in SAS but keep getting the "opening of password protected data sets is not supported" error message (see attachment). I wouldn't normally ask, but I'm getting the sense that this might be related to the version of SAS I'm using? The organization that owns the data set (the National Institute of Alcohol Use and Alcoholism - a division of the NIH) is insisting that SAS does support password protected data sets and that the issue is on my end. So I guess I'm not sure if the issue is that SAS doesn't support password protected data files in general? That the version I'm using doesn't support them? Or something else entirely? I'm accessing SAS Studio through SAS OnDemand for Academics (Release: 3.81 - Enterprise Edition). At least I think that's the version I'm using - like I said, I'm brand new and it's a little hard to tell with all of the different versions and components of SAS that are available (version info attached as well). Any help would be greatly appreciated. Thanks! Scott
... View more
I did my share of popsicle stick craft projects as a kid, including "switch blades" and "bombs." 😀
So, with Independence Day approaching, here's a quick SAS ODS Graphics take on a Popsicle Stick American Flag craft project. Happy 4th of July, all!
* Fun With SAS ODS Graphics: Stars and Popsicle Stick Stripes Forever
See craft projoect at: gingersnapcrafts.com/blast-from-past-popsicle-stick-flags;
data stripes; * Generate rectangles for 5 popsicle stick stripes;
do id=1 to 5;
color=mod(id,2); * Assign color codes 0=Red 1=White 2=Blue;
x=.33; y=(id-1)*.72; output; x=6-.33; output; y=(id-1)*.72+.66; output; x=.33; output;
end;
data canton; * Generate 3 shorter blue rectangles for canton;
do id=3 to 5;
csx=.33; csy=(id-1)*.72; output; csx=3; output; csy=(id-1)*.72+.66; output; csx=.33; output;
end;
data circles(keep=colorc xc yc); * Generate circles for rounded ends of popsicle stick stripes;
do id=1 to 5;
if id<=2 then colorc=mod(id,2); else colorc=2;
xc=.33; yc=(id-1)*.72+.33; output; colorc=mod(id,2); xc=6-.33; output;
end;
data stars(keep=xs ys); * Generate 3 rows of stars (5 in each row);
do id=3 to 5;
ys=(id-1)*.72+.37;
do s=1 to 5; xs=s*3/6; output; end;
end;
data flag; * Pull all the pieces together;
set stripes circles canton stars;
* Make a flag with polygon + ellipseparm + scatter plots!;
ods graphics / noborder height=3.54in width=6in;
proc sgplot data=flag noautolegend nowall noborder;
styleattrs backcolor=cxb1e5ff datacolors=(CXB22234 white CX3C3B6E); * "Old Glory Red/Blue";
symbolchar name=uniStar char='2605'x; * Unicode value for 5-pointed star;
polygon x=x y=y id=id / nooutline fill colormodel=(white CXB22234) colorresponse=color nomissinggroup; * Plot rectangular part of stripes;
ellipseparm semimajor=.33 semiminor=.33 / slope=1 xorigin=xc yorigin=yc fill nooutline group=colorc nomissinggroup; * Plot rounded ends of stripes;
polygon x=csx y=csy id=id / nooutline fill fillattrs=(color=CX3C3B6E); * Plot canton;
scatter x=xS y=yS / markerattrs=(symbol=unistar color=White size=48pt); * Plot stars;
xaxis display=none values=(0 6) offsetmin=.06 offsetmax=.06; * Hide axes;
yaxis display=none values=(0 3.6) offsetmin=.0625 offsetmax=.06;
run;
PRE-COLORING
... View more