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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Latest Updates
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.