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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 580 views
  • 1 like
  • 2 in conversation