My SAS Tutorials

Friday 14 March 2014

WNS Interview Questions

1.       What is PDV?
2.       Diff between where & if statement in respect to PDV?
3.       Different ways of creating macro variables.
4.       Diff between call symputx & %let.
5.       What are intck & intnx functions & what is the diff between them.
6.       What is vlookup in Excel?
7.       What are the diff types of joins?
8.       What are macros % what are the debugging techniques in macro.
9.       What is symbolgen?
10.   %let i= 1+2
%put &i.
What is the value of i.
11.   What  is the function used in macros to do arithmetic calculations?
12.   What  is the function used in macros to use SAS functions?
13.   What is data _null_ ?
14.   %let i=1
Data _null_;
Set one;
Call symputx (‘x’, 2);
Run;
%put &i
What is the value of i?

15.   %let i=1
Data _null_;
Set one;
Call symputx (‘x’, 2);
%put &i
Run;
What is the value of i?

16.    what are the key factors that should  be considered while converting .CSV, .txt & .xls to SAS data set.

17.   What is the statement used to reference .csv file in data step?

18.   Data set one has 5 observations & two has 10 observations. What will be the no. of observations in the output datasets in the below programs.

Data three;                 Data four;
Set one two;               set one;
Run;                              set two;
                                      Run;

19.   What is the name of the following methods referenced in data step processing.

Data three;                 Data four;
Set one two;               set one;
Run;                              set two;
                                      Run;


20.   Write the syntax for inner join in proc SQL & data step processing.


21 We have a SAS Data Set One:

One
Name Subject Marks
Ram                             Maths 30
Ram                     Maths  20
Ram                       Sceince   30
Ram                       Sceince   50
Ram                        Sceince   60
Ram                           History  30
Ram                          History  50

                          We need the output Like:
                                    Two
Name Subject Marks Total
Ram                             Maths 30 30
Ram                     Maths  20 50
Ram                       Sceince   30 30
Ram                       Sceince   50 80
Ram                        Sceince   60 140
Ram                           History  30 30
Ram                          History  50 80

                                     And
                                     Three


Name Subject Marks
Ram                     Maths  20
Ram                        Sceince   60
Ram                          History  50

Now prepare your Base SAS and Advance SAS Certification Exams with Online Mock tests:  http://exam.sankhyana.com

For training related info kindly mail us at info@sankhyana.com
Sankhyana Consultancy Services
www.sankhyana.com



Thursday 27 February 2014

Genpact Interview Questions

1.       Different ways of deleting duplicates from a sas data set.
2.                                                          Proc sort data=one nodupekey;
                                     By variable;
                                 Run;
Equivalent code in SQL.?
3.       Var1 var2 var3
 Create  New Variables which should contain a Difference of present observation to the previous  observation for all the three Variables.
4.       Difference b/w Proc Tabulate and Proc Report?
5.       Different ways of creating Macro Variables?
6.       How to calculate the difference in months of two Date Variables?
7.       Data set has n no of variable. Create variables like Newavr1 to n with average of 1-4 Variables for first Variable and average of 2-5 for second and so on…


Existing Variables         
Var1 Var2 Var3…… Varn       
                                                

New Variables
     Newvar1                      Newvar2                             Newvar3…….      
Avg of Var1-Var4       Avg of Var2-Var5               Avg of var3-var6.......

Now prepare your Base SAS and Advance SAS Certification Exams with Online Mock tests:  http://exam.sankhyana.com


For training related info kindly mail us at info@sankhyana.com
Sankhyana Consultancy Services
www.sankhyana.com




Sunday 19 January 2014

Nettpositive Interview Questions

NetPositive Interview Questions       
Written test had four questions.
1.       Base:
Four  variables  names with type and length were provided along with a page of conditions and specifications for each variable. A program had to be written for creating variables, also, array had to be used to perform a temporary look up and sub setting if statement was to be used in the program.

2.       Macro:
Dataset1:
Seq1  var1 var2
100  10    1
200  20    2
300  30    3

Dataset2:
Seq2 var3 var4
400  100    1
200  200    2
200  300    3

Dataset3:
Seq3 var5 var6
400  100    1
200  200    2
200  300    3

Data dataset4 ;
Set dataset1;
If _n_=1 then do ;
Temp1=var1+va2;
Temp2=var1/var2;
End;
Run;

Data dataset5;
Set dataset2;
If _n_=1 then do ;
Temp3=var3+va4;
Temp4=var3/var4;
End;
Run;


Data dataset6;
Set dataset3;
If _n_=1 then do ;
Temp5=var5+va6;
Temp6=var5/var6;
End;
Run;

Write a single macro program for the above three different programs.

3.       Merging:
Dataset1:
Seq  var1 var2
1     10    1
2    20    2
3    30    3

Dataset2:
Seq  var2 var3
1   100    1
3   200    2
3   .         4
4   300    3

Write the output for the following programs.

Data  _1;
Merge dataset 2 dataset1;
By seq;
Run;

Data _2;
Merge dataset1 dataset2;
By seq;
If first.seq and last.seq;
Run;

Data _3;
Merge dataset2(in=one)  dataset1(in=two);
By seq;
If  one and not  two;
Run;






4.       Efficiency:
If the dataset has one million of observations, which one of the following program is more efficient in terms of reducing the cpu time.


Partial dataset:
Dataset:
Var3 Seq1  var1 var2
US    100  10    1
EU    200  20    2
IND  300  30    3

Program No.1
Data US IND EU;
Set dataset;
If var3=‘US’ then output US;
If var3=’EU’ then output EU;
If var3=’IND’ then output IND;
Run;

Program no. 2
%macro report(country);
Data &country;
Set dataset;
If var3= ‘’&country ‘’ then output &country;
Run;
%mend report;
%report(US)
%report(EU)
%report(IND)
Face to face technical round:
1.       Tell me about your experience in SAS.
2.       How good are you in Macro?
3.       How do you define a variable( a macro variable)?
4.       You have a workbook test.xls. How do you access that into SAS?
5.       What are the uses of SAS ACCESS software?
6.       Have you come across DMS, any experience on that?
7.       There are two employees, x and y. Suppose the sum of their age and difference of their age is 80 and  20, respectively. What are the ages of employees? No pen and paper- one min to answer.
8.       There is a list of employee ID and every month a new employee is added. Write a Macro program to cross check the uniqueness of the employee ID. 


Now prepare your Base SAS and Advance SAS Certification Exams with Online Mock tests:  http://exam.sankhyana.com

For training related info kindly mail us at info@sankhyana.com
Sankhyana Consultancy Services
www.sankhyana.com