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

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 568 views
  • 2 likes
  • 3 in conversation