In this question, I rename the numeric variable phone to
numphone and then try use phone=put(numphone,comma16.) to
store the numeric value numphone as a string value in phone.
But I get a warning tha numphone already exists and in the
data sat phone doesnt exist and numphone is set to missing. Why?


data names_and_more;
input Name $20.
Phone : comma16.
Height & $10.
Mixed & $8.;
Name = tranwrd(Name,' ',' ');
rename phone = numphone;
phone = put(numphone,comma16.);
datalines;
Roger Cody 9,087,821,234 5ft. 10in. 50 1/8
Thomas Jefferson 3,158,488,484 6ft. 1in. 23 1/2
Marco Polo 8,001,234,567 5Ft. 6in. 40
Brian Watson 5,183,551,766 5ft. 10in 89 3/4
Michael DeMarco 4,452,322,233 6ft. 76 1/3
;

Answer Posted / kumaraswamy maduri

Yes you are right.

The way you coded tells the compiler to do two actions
simultaneosly on the PDV. The renaming will be done once
the data step is closed.

data t;
set names_and_more(rename=(phone=numphone));
phone = put(numphone,comma16.);
run;

In the above example which uses the same data that you
gave, this works the way you wanted. Dataset options work
on the dataset not on the PDV.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of the %include statement?

682


explain about sas business intelligence? : Sas-bi

596


how does sas handle missing values in a merge? : Sas programming

551


What do the sas log messages “numeric values have been converted to character” mean? What are the implications?

712


Hi Jeevan/Akshara I have tried to contact SASI Vats for latest Advanced SAS Programming Certification Dumps (A00-212) but have not got any response. I would highly and gratefully appreciate your assistance in this regard. If you guys have access to this, would you be kind enough to forward it to me ? I would abide by all the terms you have for this. Please, note my email id: upretigopi@yahoo.com Preti Sharma

3056






what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming

543


Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya

1343


what is the function of catx syntax? : Sas-administrator

643


Explain the special input delimiters used in sas programming.

581


What is Linear Regression?

683


Have you ever used the SAS Debugger?

1203


What does the RUN statement do?

847


What are the ways to do a “table lookup” in sas?

589


what do the sas log messages "numeric values have been converted to character" mean? What are the implications? : Sas programming

686


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

624