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.
Hello
Let's say that I want to create a data set based on sas_help.class data set.
The new data set will have only 2 columns: Var_name , Var_Value
What is the way to do it?
I expect that the new data set will have 95 rows (because in sas_help.class have 19 rows with 5 columns so 19*5=95)
thanks
... View more
Hello
With continue to previous post,
I want to create a new data set based on sashelp.class data set .
I want that in new data set will have 2 columns; Var_name ,Var_value.
I want it to be done only for numeric vars.
I want to identify the numeric vars automatically (Because I want to apply this code on different data sets)
proc sql;
create table numeric_Vars as
select libname, memname, name, type, length,
format, informat, label
from dictionary.columns
where libname = 'SASHELP' and memname = 'CLASS' and upcase(type) = 'NUM'
;
quit;
proc sql noprint;
select name into : Numeric_Vars_List SEPARATED by ' '
from numeric_Vars
;
quit;
%put &Numeric_Vars_List.; /**Age Height Weight**/
proc sql noprint;
select count(*) as nr_numeric_Vars into :nr_numeric_Vars
from numeric_Vars
;
quit;
%put &nr_numeric_Vars.;
data Long_Structure_Numeric_Vars_Data;
set sashelp.class;
array vv{&nr_numeric_Vars.} &Numeric_Vars_List.; /* _NUMERIC_ */
do j=1 to dim(vv);
Var_Name = vname(vv(i));
Var_Value = vv(i);
output;
end;
run;
The error in log is:
INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result.
31:1 Var_Name
NOTE: Variable i is uninitialized.
ERROR: Array subscript out of range at line 31 column 19.
Name=Alfred Sex=M Age=14 Height=69 Weight=112.5 j=1 Var_Name= i=. Var_Value= _ERROR_=1 _N_=1
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 1 observations read from the data set SASHELP.CLASS.
WARNING: The data set WORK.LONG_STRUCTURE_NUMERIC_VARS_DATA may be incomplete. When this step was stopped there were 0
observations and 9 variables.
... View more
%macro sort (dname, new, svar) ;
proc sort data=&dname out=&new ;
by &svar;
run;
%Mend;
%sort(sashelp.class, demo1,sex);
data _null_;
if cexist("WORK.SORT") then
put "WORK.SORT exists";
else
put "WORK.SORT does not exist";
run;
Hi Experts,
here i am trying macro catolog exist or not but its giving wrong output please check where i did wrong
... View more
Dear SAS community, I am trying to run weighted models for nested data (a panel survey) using PROC GLIMMIX; however, I keep getting an error and a warning (please see the SAS code and log below). I modified the Glimmix code a bit (added points and specified GCONV), but the error and the warning are still the same. When I remove the "obsweight=HCNSWGTR" and use method=laplace, the code runs just fine. Do you have any suggestions on how to address this issue? I have also attached my data. Thanks. PROC GLIMMIX DATA = test1 METHOD=QUAD(FASTQUAD QPOINTS=100) plots=all;
CLASS RAHHIDPN STRATCLUS GENDER(REF='1') RACE_ETH(ref='1') MARITAL(ref='1');
MODEL MOBILITY = BSAGE_C BSAGE_C*BSAGE_C GENDER GENDER*BSAGE_C RACE_ETH RACE_ETH*BSAGE_C RACE_ETH*GENDER
TIME TIME*TIME TIME*BSAGE_C TIME*GENDER TIME*RACE_ETH/solution obsweight=HCNSWGTR ;/**LEVEL 1 VARIABLES**/
RANDOM INTERCEPT /subject=STRATCLUS type=VC ;
RANDOM INTERCEPT /subject=RAHHIDPN(STRATCLUS) type=VC ;
NLOPTIONS GCONV=0.00001;
COVTEST/WALD;
ODS OUTPUT parameterestimates=FIXED1 covparms=RAND1;
RUN; NOTE: PROCEDURE GLIMMIX used (Total process time):
real time 24.92 seconds
cpu time 11.03 seconds
326 PROC GLIMMIX DATA = test1 METHOD=QUAD(FASTQUAD QPOINTS=100) plots=all;
327 CLASS RAHHIDPN STRATCLUS GENDER(REF='1') RACE_ETH(ref='1') MARITAL(ref='1');
328 MODEL MOBILITY = BSAGE_C BSAGE_C*BSAGE_C GENDER GENDER*BSAGE_C RACE_ETH RACE_ETH*BSAGE_C RACE_ETH*GENDER TIME TIME*TIME TIME*BSAGE_C TIME*GENDER TIME*RACE_ETH/solution obsweight=HCNSWGTR ;
330 RANDOM INTERCEPT /subject=STRATCLUS type=VC ;
331 RANDOM INTERCEPT /subject=RAHHIDPN(STRATCLUS) type=VC ;
332 NLOPTIONS GCONV=0.00001;
333 COVTEST/WALD;
334 ODS OUTPUT parameterestimates=FIXED1 covparms=RAND1;
335 RUN;
WARNING: Class levels for RAHHIDPN are not printed because of excessive size.
ERROR: QUANEW Optimization cannot be completed.
WARNING: The initial estimates did not yield a valid objective function.
NOTE: The data set WORK.RAND1 has 3 observations and 4 variables.
WARNING: Output 'parameterestimates' was not created. Make sure that the
output object name, label, or path is spelled correctly. Also,
verify that the appropriate procedure options are used to produce
the requested output object. For example, verify that the NOPRINT
option is not used.
NOTE: PROCEDURE GLIMMIX used (Total process time):
real time 5:39.58
cpu time 2:48.00
... View more
Hi Experts
I am download anaconda distribution jupyter notebook for SAS kernal
i am install my PC
python 3.12.3 version
i am getting below error please advice any requeiements software are must be downloaded like Java 8 in my system
... View more