BookmarkSubscribeRSS Feed
Pandu
Fluorite | Level 6

Hi All,

 

I have a variable name Policy_no and the values are

 

Policy_no

56789/k0256

58796548/k908

4785/Nk02

 

I want to read the value before /      or  want to delete  (/k0256)

 

finally i want to read as below

 56789

     58796548

     4785

 

Thank you in advance

2 REPLIES 2
Astounding
PROC Star
Start with:

part1 = scan(policy_no, 1, '/');
part2 = scan(policy_no, 2, '/');

That gives you the pieces before and after the/ as separate variables.

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
  • 476 views
  • 0 likes
  • 3 in conversation