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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 523 views
  • 1 like
  • 2 in conversation