Numeric to character conversion

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 120
Accepted Solution

Numeric to character conversion

I have the following data.

Name     Age      Title

Tom         .       Analyst

Mike         .       VicePresident

John        .        AccountManager

....and I need it to look like this.

Name     Age      Title

Tom                   Analyst

Mike                   VicePresident

John                   AccountManager

By design, the variable Age is numeric and only holds blanks. I need to eliminate the dots associated with numeric blanks, such that the Age variable is completely clear (ie. the Age variable blanks need to look like numeric blanks). The only way I know to do this, however, is to introduce a new variable that contains Age's values and recast the new variable as a character and set it to blank with an if statement. It is imperative, however, that I keep Age variable in the same location within the dataset (ie between the Name and Title variables), so I am not able to get there with what I know.

Any suggestions?


Accepted Solutions
Solution
‎09-22-2014 01:47 PM
Respected Advisor
Posts: 3,124

Re: Numeric to character conversion

options missing='';

View solution in original post


All Replies
Solution
‎09-22-2014 01:47 PM
Respected Advisor
Posts: 3,124

Re: Numeric to character conversion

options missing='';

Grand Advisor
Posts: 10,210

Re: Numeric to character conversion

The . for missing is a system option. Inside a dataset I wouldn't worry about it. For any report procedure or data export before the procedure use:

options missing=' '; to have a single space instead of the period appear. Reset to default afterwards using option missing='.';

If you are really worried about the appearance within a data set then use the same option missing=' ';

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 152 views
  • 3 likes
  • 3 in conversation