My SAS Tutorials

Wednesday 27 February 2013

SAS INTERVIEWS CONCEPTUAL QUESTIONS I

We have a raw data set:


Formatted Input 

Ram     21 500    Friday,January 1,1960
Sita      22  600   Saturday,january 1,1960
Radha 23 700     Sunday,january 1,1960

We have to create a SAS dataset from this raw data set.

output:

Name       Age    Salary     Hire_date
Ram           21       500       01jan1960
Sita            22       600       02jan1960
Radha       23        700       03jan1960

Please write SAS Program to complete this task.

Solution:



data one;
infile 'Filename';
length x $ 10 y $ 10 z $ 10 b $ 15;
input name $ age salary @15 H_D $30.;
keep name age salary Hire_date;
x=scan(H_D,2);
z=scan(H_D,4);
a=strip(x)||strip(z);
b=tranwrd(a,substr(a,1,length(a)-4),substr(a,1,3));
day+1;
k=month(input(b,monyy7.));
Hire_Date=mdy(k,day,z);
format final date9.;
run;
proc print data=one;
run;



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
www.sankhyana.com

Monday 18 February 2013

Project I


1>You have data sets of 12 months for 5 years. Means we have 60 data-sets in a library. Common variables(sale_date sale_amount   customer_id product_id (five products),quantity).(create data sets for every month having 10 obs).

2> We have to save the printed output of all the data-sets in a html sheets.

3>The log information should be saved in a separate text file.

4>Now calculate the average sales of each month and average sales year wise.

6>Calculate the sum of sales for entire 5 years.

7>Create the month wise sales and save in another data-set.

8>Predict the sales  for the coming first quarter for every product.

9>Use macros to solve this scenario.

10>Benchmark the technique and show the report why your technique is efficient(In terms of resource utilization i.e programmers time, CPU utilization, Network Bandwidth, memory uses , I/O, Disk Space).


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
www.sankhyana.com