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
I have a string that have 3 words with two commas between them.
I want to calculated 3 fields- continent, city,country.
Can anyone explain why City=scan(X,-2,","); result with city?
In this case there are 2 commas, to which comma this code refer to? to first or second?
As I understand since -2 is negative then it search for the word in right side of the comma?
data have;
input X $20.;
cards;
EU,Athens,Greece
Asia,Beijing,China
;
run;
data want;
set have;
continent=scan(X,1,",");/**EU**/
City=scan(X,-2,",");/**Athens**/
Country=scan(X,-1,",");/**Greece**/
Run;
... View more
Please direct me if I am in the wrong location. I will still ask the question here. I have sas 9.4 version TS1M7. I have difficulty scrolling up and down the Enhanced Editor Window. its very lagging, but log window is working with sufficient speed. How to fix this. I tried changing the size of the font and different options in SAS> Tools sections.. How to solve this issue
... View more
I'm just checking my understanding. From what I understand, if the following is correct:
Then is the following not correct? My responses would have been: 189.87%, 696.20% and 31.54%.
... View more
Hi folks,
I am attempting to read an xlsx file into SAS without SAS doing anything to modify the the variable types or the characters as they appear when viewing the xlsx file in Excel. In other words, if something looks like a date, regardless of how it's stored in the xlsx file (e.g., "11/25/2023"), it'll show up in sas as a character variable as that same value (e.g., "11/25/2023"). In other words, I'd like to replicate what the Import Data wizard in SAS does when it just defines all fields as character, as in the following attributes for one particular column, for example:
type=String
Source Informat=$CHAR29
Len.=29
Output Format=$CHAR29.
Output Informat=$CHAR29.
The code automatically generated from the Import Data wizard when I do this contains the DATALINES4 statement, which I can't use because I can't just fill all of these in, as I'm trying to load the data in without having to look at the contents. I'd be fine, though, if I can define the variable types/lengths/formats/etc., as I know what the variables are and what they'll be named.
How do I do this without having to fill in the DATALINES4 content?
I need to be able to specify the sheet within the Excel workbook in question as well.
Thanks!
... View more
Hi everyone,
I’ve used PROC CAUSALGRAPH to identify a valid adjustment set of variables to include in my model (which will use inverse probability weighting).
In the SAS documentation, and specifically the example “Causal Model of the Effect of Persistent Perfluoroalkyl Substances on Breastfeeding Duration”, data on six variables are available: Age, BMI, Education, Employment, Parity, and PrevBF.
PROC CAUSALGRAPH recommends the following valid adjustment set of 4 variables: Education, Employment, Parity, and PrevBF.
Note, Age and BMI are not included in this adjustment set.
I understand the reasoning behind this, but my question is, if I plan to run inverse probability weighting, using PROC CAUSALTRT, these are the 4 variables I will be included in both PSMODEL and MODEL statements…. and in the output, I’ll get unweighted and weighted values which I will then include in a Table in my report.
Staying with the same example from the SAS documentation, if I do this, then I won’t have an unweighted and weighted value for age and BMI, so what do I do when reporting this in the table?
Any help/comments would be greatly appreciated,
Thank you,
... View more