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!
Dear, I am calculating CI using stratified Newcombe method in Proc Freq, however i have control arm with zero responder and this study have two stratification factor, while running to code i m getting message that "NOTE: Newcombe confidence limits for the common risk difference cannot be computed for this table (Treatment by Responder controlling for startum) due to zero-frequency rows, columns, or cells." I checked paper and it is possible that we can calculate CIs even L2 and U2 are zero. could you please help why SAS is not showing results in this particular case.
... View more
Hi,
I have 2 datasets as below: 'insects' and 'test1'.
Data test1 has thousands of rows with many columns including binary 1/0 ins_ant, ins_bee. ins_beetle.
I want to calculate new columns 'total_weight' and 'total_id' based on the values in Data insects (sum of the corresponding "weight"s and "id"s.)
I'm using a proc format to do this, my code is below.
I used type = 'I' because my input is a string (insect name) and outputs are numbers, and that's the informat type to use to the documentation here - SAS Help Center: Results: PROC FORMAT
But my final output dataset test2 has null values for the total_weight and total_id columns.
What am I doing wrong?
Or please let me know if there's a simpler way to do this (without using proc format, but also without hardcoding anything like names of insects/weights/ids/number of insects etc.)
Thank you!!
code:
data insects;
length insect $100.;
insect='ant';
weight = 10;
id0 = 1;
output;
insect='beetle';
weight = 20;
id0 = 2;
output;
insect='bee';
weight = 30;
id0 = 3;
output;
run;
data fmt;
set insects;
length start $100;
start = upcase(strip(insect));
retain type 'I';
fmtname = 'weight';
label = weight;
output fmt;
fmtname = 'id';
label = id0;
output fmt;
keep start fmtname label type;
run;
proc format cntlin=fmt;
run;
data test1;
patient = 4772;
ins_ant = 1;
ins_bee = 1;
ins_beetle = 0;
output;
patient = 6792;
ins_ant = 0;
ins_bee = 1;
ins_beetle = 1;
output;
run;
data test2;
set test1;
total_weight = 0;
total_id0 = 0;
array ins_all {*} ins_: ;
do i_local = 1 to dim(ins_all);
total_weight = total_weight + ( ins_all[i_local] * input(upcase(strip(scan(vname(ins_all[i_local]),2,'_'))),weight.) );
total_id0 = total_id0 + ( ins_all[i_local] * input(upcase(strip(scan(vname(ins_all[i_local]),2,'_'))),id.) );
end;
drop i_local;
run;
... View more
Is it possible to use a picture format for the values a time axis?
In my test, it does not work.
proc format ;
picture monyyd (default=6) low - high = '%b-%y' (datatype=date);
run;
data class;
set sashelp.class;
if sex='M' then month='01MAR2024'd;
else month='01APR2024'd;
monthc=put(month,monyyd.);
run;
proc sgplot data=class;
vbarbasic monthc / response=height stat=mean;
run;
proc sgplot data=class;
vbarbasic month / response=height stat=mean;
xaxis values=('01MAR2024'd to '01APR2024'd by month)
type=time
interval=month
valuesformat=monyy5.;
run;
proc sgplot data=class;
vbarbasic month / response=height stat=mean;
xaxis values=('01MAR2024'd to '01APR2024'd by month)
type=time
interval=month
valuesformat=monyyd.;
run;
... View more
Hello there!
I have two compute tiers (two object spawners).
One for running SAS MA campaigns in real time and another one for scheduling SAS MA campaigns.
It's easy to change the scheduling server, but I don't know how to change the default compute tier.
For example, when I press the run campaign button in the SAS MA web interface, how to change the executing server?
I need to set the pooled workspace server in the second compute tier as default.
... View more
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.