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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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