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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
DATA ABC;
INPUT TDATE DATE9. AVG;
CARDS;
18APR2008 150.00
19APR2008 167.00
20APR2008 123.00
21APR2008 145.00
;
RUN

HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF
21APR2008??

IF ANY ONE GETS IT PLS TRY TO POST IT.
 Question Submitted By :: Gajari Rao
I also faced this Question!!     Rank Answer Posted By  
 
  Re: DATA ABC; INPUT TDATE DATE9. AVG; CARDS; 18APR2008 150.00 19APR2008 167.00 20APR2008 123.00 21APR2008 145.00 ; RUN HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF 21APR2008?? IF ANY ONE GETS IT PLS TRY TO POST IT.
Answer
# 1
DATA ABC; 
INPUT TDATE DATE9. AVG; 
CARDS;
18APR2008 150.00
19APR2008 167.00 
20APR2008 123.00
21APR2008 145.00
; 
RUN; 

data _null_;
set abc;
if tdate='18APR2008'D then 
call symput('x',avg);
if tdate='21APR2008'D then 
call symput('y',avg);
z=&x-&y;
run;

data _null_;
z=&x-&y;
put 'the difference='z;
run;
 
Is This Answer Correct ?    1 Yes 0 No
Rajaanku11
 
  Re: DATA ABC; INPUT TDATE DATE9. AVG; CARDS; 18APR2008 150.00 19APR2008 167.00 20APR2008 123.00 21APR2008 145.00 ; RUN HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF 21APR2008?? IF ANY ONE GETS IT PLS TRY TO POST IT.
Answer
# 2
Hi, pls modify slight changes to the above prog.

data _null_ ;
set abc;
if tdate='18APR2008'D then 
call symput('x',avg);
if tdate='21APR2008'D then 
call symput('y',avg);
run;
%put _user_;
data _null_;
z=&x-&y;
put 'the difference=' z;
run;
 
Is This Answer Correct ?    0 Yes 0 No
Rajaanku11
 
 
 
  Re: DATA ABC; INPUT TDATE DATE9. AVG; CARDS; 18APR2008 150.00 19APR2008 167.00 20APR2008 123.00 21APR2008 145.00 ; RUN HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF 21APR2008?? IF ANY ONE GETS IT PLS TRY TO POST IT.
Answer
# 3
The Above can be done in a single data step as 
follows.Actually this is suggestable.


data _null_;
set abc;
retain z;
if tdate='18APR2008'D then
z=avg;
if tdate='21APR2008'D then
do;
diff=Z-avg;
put 'the difference=' diff;
stop;
end;
run;
 
Is This Answer Correct ?    1 Yes 0 No
Rajaanku11
 
  Re: DATA ABC; INPUT TDATE DATE9. AVG; CARDS; 18APR2008 150.00 19APR2008 167.00 20APR2008 123.00 21APR2008 145.00 ; RUN HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF 21APR2008?? IF ANY ONE GETS IT PLS TRY TO POST IT.
Answer
# 4
Hi, 
I am think that the difference between the first and last 
records value?

data _null_;
set abc end=last;
retain first;
if _n_=1 then first=avg;
if last=1 then do;
diff=first - avg;
put 'The difference is =' diff;
stop;
end;
run;

here _n_=1 is hold the first record in the abc dataset.
Last=1 means is hold the last record in the dataset.
 
Is This Answer Correct ?    0 Yes 0 No
Nagesh Sriram
 
  Re: DATA ABC; INPUT TDATE DATE9. AVG; CARDS; 18APR2008 150.00 19APR2008 167.00 20APR2008 123.00 21APR2008 145.00 ; RUN HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF 21APR2008?? IF ANY ONE GETS IT PLS TRY TO POST IT.
Answer
# 5
We can solve this with array......
 
Is This Answer Correct ?    0 Yes 1 No
Chandu
 

 
 
 
Other SAS Interview Questions
 
  Question Asked @ Answers
 
what are the differences between proc report and proc tabulate?  1
What is the one statement to set the criteria of data that can be coded in any step? Accenture3
If you’re not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set? Accenture3
How would you code the criteria to restrict the output to be produced?  6
What report output formats can you generate using SAS? Accenture2
What do you feel about hardcoding? Pfizer3
There is a river notoriously known for it?s large crocodile population. With ease, how do you safely cross it? Oracle1
How to read multiple excel sheets from a single excel file at once???? Verinon-Technology-Solutions3
How would you code the criteria to restrict the output to be produced? Accenture5
How would you generate 1000 observations from a normal distribution with a mean of 50 and standard deviation of 20. How would you use PROC CHART to look at the distribution? Describe the shape of the distribution.  1
I have 50 variables in one data set, In reports i want to generate every 10 variables in one page how we will write code in proc report.  3
Do you prefer Proc Report or Proc Tabulate? Why? Oracle6
how do you validate sas program? Accenture3
How to select the observations randomly from a SAS dataset  4
What do you feel about hardcoding?  1
is there any difference between proc summary and proc means?  2
How would you remove a format that has been permanently associated with a variables?  2
How do you read in the variables that you need?  5
how to write code for left outer join in SAs using datastep? CitiGroup4
How would you delete observations with duplicate keys?  5
 
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