Given the following dataset:
libname results 'c:\cert\output';data results.output03_1 (drop=n);set cert.input03;n=find(major,'and','i');if n^=0 then do;second_major=subtr(major,n+4);major=subtr(major,1,n-2);end;run;
What do the above bold parts "i" "n+4" and "n-2" mean?
Thanks!
i - case insensitive search
n- starting position of the word searched in the string
n+4 - starting position from which substr will start to extract chars
n-2- evaluates to length of chars that the substr will extract
Please get hold of SAS functions by example- A book by author Ron cody
View solution in original post
You can also look up what SAS functions do, and what the options do, here:
Alphabetical List of All SAS 9.4 Functions
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Submit your idea!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.