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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 395 views
  • 0 likes
  • 3 in conversation