DATA Step, Macro, Functions and more

How to keep dots between numbers when compress function is used

Reply
Super Contributor
Posts: 272

How to keep dots between numbers when compress function is used

Dear,

 

In my data one of the value is "Visit 15.1". I am getting 151 with my code. Which modifier I need to use to get15.1. Thank you very much

 

VISITNUM=input(COMPRESS(VISIT,,'kd'),best.);

Super User
Posts: 5,509

Re: How to keep dots between numbers when compress function is used

Posted in reply to knveraraju91

VISITNUM=input(COMPRESS(VISIT,'.','kd'),best.);

 

The "K" will apply to both the "." and the "d".

Ask a Question
Discussion stats
  • 1 reply
  • 99 views
  • 1 like
  • 2 in conversation