SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Variable Day converting numeric to character

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

Variable Day converting numeric to character

Hi, running Glimmix on Variable "Day" has to be not numeric 

 

I have Variable Day with values from 1,3,5,7,9,11,13 ...24) 

 

Just want SAS University to consider the variable Day as char and not as numeric as it is from the proc import ... 

 

how to do this simply for a dummy please? 


Accepted Solutions
Solution
‎10-31-2016 01:38 PM
Super User
Posts: 10,500

Re: Variable Day converting numeric to character

Easiest is going to be using a data step or transform to create a new variable.

Data step code would look like:

 

data want;

    set have;

    DayText = put(day,best5.);

run;

 

You don't say what your actual range of DAY is best5 will work for values up to 99999. If you don't need that many characters you could use BEST2.  or Best3. or ..

View solution in original post


All Replies
Solution
‎10-31-2016 01:38 PM
Super User
Posts: 10,500

Re: Variable Day converting numeric to character

Easiest is going to be using a data step or transform to create a new variable.

Data step code would look like:

 

data want;

    set have;

    DayText = put(day,best5.);

run;

 

You don't say what your actual range of DAY is best5 will work for values up to 99999. If you don't need that many characters you could use BEST2.  or Best3. or ..

Contributor
Posts: 20

Re: Variable Day converting numeric to character

Thanks kindly!
☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 282 views
  • 0 likes
  • 2 in conversation