Help using Base SAS procedures

Index function

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

Index function

Hi,

I have this number (PID)and we want to create two numbers from it

00000000-11111111

Please correct me


Accepted Solutions
Solution
‎04-23-2013 01:01 AM
Contributor
Posts: 46

Re: Index function

Hi Robertrao,

Yes, it is right.The index function returns a value of 9, so the substr function take the values from 10th position.

View solution in original post


All Replies
Respected Advisor
Posts: 3,777

Re: Index function

Add 1 to the value returned by index.

Super Contributor
Posts: 1,040

Re: Index function

Could you please explain the full line ...what happens when 1 is added to the value returned by index???????/

so that position becomes the starting point for the substring instead of the usual "first position"?

In this example:

00000000-11111111

the index returns  a value of 9(hyphen is in the 9th position)

so +1 means "we are telling the substr function to take the values from 10th position????is that right?

aND FROM THERE WE ARE TAKING 9 CHARECTERS???/

Solution
‎04-23-2013 01:01 AM
Contributor
Posts: 46

Re: Index function

Hi Robertrao,

Yes, it is right.The index function returns a value of 9, so the substr function take the values from 10th position.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 198 views
  • 3 likes
  • 3 in conversation