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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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