DATA Step, Macro, Functions and more

Character to Numeric conversion issues

Reply
Occasional Contributor
Posts: 7

Character to Numeric conversion issues

[ Edited ]

Is it possible to change the type of a variable from character to numeric without creating a new variable and applying input statement on the variable required to be converted.

 

eg:

if i have a variable A which is character and having various date values.

        A

13 Jun 1991

20 Aug 1989

 

so now can i convert the variable A directly from character to numeric. and apply the date formats as i required.

 

Kindly help!

 

Super User
Posts: 10,215

Re: Character to Numeric conversion issues


@mahen wrote:

Is it possible to change the type of a variable from character to numeric without creating a new variable and applying input statement on the variable required to be converted.

Kindly help!


No. You have to play the rename/input/drop game.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 7

Re: Character to Numeric conversion issues

Posted in reply to KurtBremser

oh okay!

Thank You Kurt.

Super User
Super User
Posts: 9,599

Re: Character to Numeric conversion issues

Do please mark @KurtBremser's answer as correct.

Occasional Contributor
Posts: 7

Re: Character to Numeric conversion issues

Okay Thank You!

Ask a Question
Discussion stats
  • 4 replies
  • 66 views
  • 0 likes
  • 3 in conversation