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

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

SAS Innovate 2025: Call for Content

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!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 2 replies
  • 509 views
  • 2 likes
  • 3 in conversation