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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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