ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Data Warehouse  >>  SAS
 
 


 

 
 Teradata interview questions  Teradata Interview Questions
 Business Objects interview questions  Business Objects Interview Questions
 Cognos interview questions  Cognos Interview Questions
 Informatica interview questions  Informatica Interview Questions
 Crystal Enterprise Suite interview questions  Crystal Enterprise Suite Interview Questions
 Actuate interview questions  Actuate Interview Questions
 Ab Initio interview questions  Ab Initio Interview Questions
 Data Stage interview questions  Data Stage Interview Questions
 SAS interview questions  SAS Interview Questions
 Micro Strategy interview questions  Micro Strategy Interview Questions
 ETL interview questions  ETL Interview Questions
 Data Warehouse General interview questions  Data Warehouse General Interview Questions
Question
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
;
 Question Submitted By :: Deepak
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
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
Kumaraswamy Maduri
 

 
 
 
Other SAS Interview Questions
 
  Question Asked @ Answers
 
When looking for data contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc? Accenture2
what does .. meant in sas macros D&B2
what are the validation tools in sas?  1
Do you prefer Proc Report or Proc Tabulate? Why? Oracle6
What do you feel about hardcoding? Pfizer3
WHAT IS LAG FUNCTION ? WHERE CAN YOU IMPLEMENT THIS FUNCTION? Zensar2
is there any difference between proc summary and proc means?  2
What is difference between rename and lable in sas? Satyam9
Explain the message 'Merge has one or more datasets with repeats of by variables'.  2
what is Difference between PROC SQL JOINS and MERGE? Accenture1
Code a PROC MEANS that shows both summed and averaged output of the data.  3
Do you use PROC REPORT or PROC TABULATE? Which do you prefer? Explain.  3
If reading an external file to produce an external file, what is the shortcut to write that record without coding every single variable on the record? Accenture3
What statement do you code to tell SAS that it is to write to an external file?  5
What are the criticality that you have faced during your project in SAS?  2
Have you ever linked SAS code, If so, describe the link and any required statements used to either process the code or the step itself?  3
%STPbegin;%STPEND; ERROR: No logical assign for filename _WEBOUT. WARNING: No body file. HTML output will not be created. unable to fix it.plz help  2
how do u identify a macro variable  4
what is the need of INDEX in datasets? CitiGroup4
What is the difference between nodup and nodupkey options? iFlex11
 
For more SAS Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com