BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zihdonv19
Quartz | Level 8

Given the following dataset:

 

zihdonv19_0-1592417205602.png

 

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!

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

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

2 REPLIES 2
novinosrin
Tourmaline | Level 20

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

PaigeMiller
Diamond | Level 26

You can also look up what SAS functions do, and what the options do, here:

Alphabetical List of All SAS 9.4 Functions

--
Paige Miller