Help using Base SAS procedures

Reg:Char and Num

Reply
Regular Contributor
Posts: 229

Reg:Char and Num

data pno;
input policyno;
cards;
AS789,A745,WE425
QW45,CV956,PO789
A75,P45632,WE452
run;


I want the policy no having twocaharater and three numeric obs.

output

AS789,WE425
CV956,PO789
WE452
Super User
Posts: 5,260

Re: Reg:Char and Num

There are a variety of function that tests for numeric/char that could be used together with SUBSTR.

/Linus
Data never sleeps
Contributor
Posts: 66

Re: Reg:Char and Num

But how can we do this by substr as the obs are at different positions.
Super User
Posts: 5,260

Re: Reg:Char and Num

You can use the scan function to put each policy in their own column/observation.
/Linus
Data never sleeps
Ask a Question
Discussion stats
  • 3 replies
  • 121 views
  • 0 likes
  • 3 in conversation