16,167 questions
0
votes
1
answer
64
views
Prevent cntlin to truncate variable values
I 'm using the following code to set the format of my variable of interest:
data thenameofmyvar;
length label $200.;
set mydb(keep= thenameofmyvar);
retain fmtname '$myfmt' type '$';
...
1
vote
1
answer
70
views
Flag variables of a dataset based on specified rules
suppose to have the following dataset:
data mydataset;
infile datalines;
input ID $ Relation $ Type $ G5 $;
datalines;
001 Related A Y
001 PossiblyRelated B Y
001 NotRelatd ...
0
votes
1
answer
54
views
SAS Date formats mmddyy8
Need a SAS date in mmddyy8. format running Windows 11 Enterprise on PC SAS 9.4.
Code below, does in fact, derive the first date ("Q_start") of the month of the current quarter of the ...
2
votes
2
answers
90
views
Proc sql in data step
I would like to ask if it is possible to include a proc sql in data step like this:
data mydata;
set have;
proc sql;
create table adrs01 as /*This line I suppose should be removed*/
...
0
votes
3
answers
138
views
Why am I getting this error - "A character operand was found in the %EVAL function or %IF condition where a numeric operand is required."
Getting an error which I have fixed, but I can't explain or understand WHY it's happening and would appreciate insight so that I can be confident my company's SAS install isn't haunted.
Getting this ...
1
vote
1
answer
102
views
Insert variables in a do loop
I have a list of variables named: Type1__2, Type2__2, Type3__2, ....,
that I would like to insert in a do loop. I would like not to list them since they are many. In a "typical" situation ...
Advice
0
votes
0
replies
36
views
Reproducing XGBoost with Robust PCA: how to ensure deterministic PCA components for validation?
I’m trying to reproduce an ML pipeline (built in SAS Viya Model Studio, but the question is general) consisting of:
Robust PCA with automatic/optimal component selection
XGBoost with auto-tuned ...
0
votes
4
answers
86
views
How to recursively get SAS dataset creation dates on Linux with NOXCMD (Pipe disabled)? [closed]
I am running SAS on a Linux server where XCMD (system commands) is disabled, so I cannot use the Pipe/Find method.
I need a pure SAS macro that can:
Recursively scan a directory.
Get the Internal ...
0
votes
2
answers
88
views
Hiding values of macro variables from libname statements
I would like to hide values of certain macro variables (passwords) used in libname statement from logs. Disabling symbolgen, mlogic or mprint is not an option, as debugging without those options is a ...
1
vote
4
answers
113
views
SAS prxmatch how to deal with searching for a " within the middle of the expression?
%if %sysfunc(prxmatch(/^\("([A-Za-z])"\)$/, %str(&names))) = 0 and %upcase(&stringC) = N %then %do;
%put ERROR: Please format as such ("obesity","diabetes&...
1
vote
2
answers
177
views
How do I randomize what rows I import from an SAS file?
The files are over 100gb and I want 1000 observations but not the first 1000, how can I make sure it's randomized before/while importing so that not all of it has to be loaded in?
data <- lapply(...
0
votes
0
answers
91
views
How to read and access Excel sheets using xlsx engine
libname xldata xlsx 'C:/Users/user/Documents/WB.xlsx';
proc print data=xldata.abc;
run;
I want to read and access Excel sheet, but I get this error:
1 OPTIONS NONOTES NOSTIMER NOSOURCE ...
0
votes
0
answers
151
views
Python coding on SAS Viya
I'm using SAS Studio. I want to learn python coding on SAS Viya. If possible, would like to migrate my existing SAS codes to python but to start with I want to learn the basics. I tried a basic query -...
1
vote
1
answer
88
views
SAS Mainframe ASA Carriage Control Behaviour
I am currently working on SAS conversion to python. I noticed that there are ASA Carriage Control Character at the first column in the output file in mainframe. After some research, I noticed that 1 ...
1
vote
1
answer
130
views
Connect to SAS server from R via SAS JDBC - dbConnect Error
I am trying to connect to work SAS server from R, to extract datasets for further processing/analysis in R.
Due to corporate constraints, the only solution available is SAS JDBC type of connection, ...