Recently in the SAS Community Library: SAS' @Sundaresh1 highlights a sometimes overlooked task when applying document embeddings for purposes of similarity-based search. Normalisation of vectors helps obtain relevant matches.
%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
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
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
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
A new update is available for SAS/ACCESS Interface to Microsoft SQL Server , version 9.45 : Hot Fix: M2L006 - Published 21MAY2024 , Download link for M2L006 Component name: DataDirect ODBC Driver for Microsoft SQL Server Related SAS release: 9.4 Issues addressed in M2L006 SAS Note 70800 Writing to Microsoft SQL Server fails with \"ERROR: CLI describe error: [SAS][ODBC 20101 driver][Microsoft SQL Server]...\" This list of notes might be incomplete. For a complete list of issues addressed by this hot fix, visit the hot fix page for M2L006 Note: A comprehensive list of all SAS hot fixes is available from support.sas.com. You can use the SAS Hot Fix Analysis, Download, and Deployment (SASHFADD) tool to manage your SAS hot fixes.
... View more