BookmarkSubscribeRSS Feed
aboral
Fluorite | Level 6

Hello, I have a dataset "flights" with a variable flight which is numeric.

Screenshot 2018-11-16 at 2.30.25 AM.png

 I am trying to convert this to a character variable.  I used the code  with put ( ) function but nothing happens. I have also tried using a different name for the new variable but it does not help. Can someone please help me out. I am using SAS University Edition.

Thanks and Regards.

 

data flights_1;
set flights;
flight_c = put (flight, 8.);
run;

 

data flights_1;
set flights;
flight = put (flight, 8.);
run;
 
3 REPLIES 3
novinosrin
Tourmaline | Level 20

Let us know what happened with sample data, log, output etc

 

and run a proc contents of your dataset and provide us that report too

aboral
Fluorite | Level 6

@novinosrin Thank you for you time to look into this. While preparing a sample as you said I noticed flight_c has been already created as a character type. It was really stupid of me and I am embarrassed. I apologise for the inconvenience.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 946 views
  • 1 like
  • 2 in conversation