Month: September 2012

SAS Practice Question – 2

SAS Practice Question – 2

 

 

 

Here is a SAS dataset as follows:

SOURCE

C_N

SEX

AGE

H DELHI    
P Sehwag M 29
P Mericom F 28
P Goutam M 26
H CHENNAI    
P Raina M 27
P Mithali F 24
H MUMBAI    
P Sachin M 32
P Saina F 26

 

Write a SAS code to create a new dataset from the above table as follows:

CITY NAME SEX AGE
DELHI Sehwag M 29
DELHI Mericom F 28
DELHI Goutam M 26
CHENNAI Raina M 27
CHENNAI Mithali F 24
MUMBAI Sachin M 32
MUMBAI Saina F 26

 

 

Try for it.

And you can check your answers in next post.

 

Arvind Dama,

80888 54454.

SIGNET Info Solutions

 

Arvind Dama – Answer for the SAS Practice Qstn-1

Answer for the SAS Practice Qstn-1

 Here the task is to create three different variables form prd variable.

 

data raw_product;
input id prd$20.;
cards;
1001 bike101victor
1002 car9696wagonR
1003 lorry874984leyland
1004 truck2tata
1005 auto84848ace
1006 scooter787878vespa
1007 aeroplane9999099kingfisher
1008 train111111rajadhani
;
run;
proc print;
run;

data multi_product;
set raw_product;
drop temp_prd;
temp_prd = substr(prd, anydigit(prd) );
a = substr(prd, 1, anydigit(prd)-1);
b = substr(temp_prd, 1, anyalpha(temp_prd)-1);
c = substr(temp_prd, anyalpha(temp_prd) );
run;
proc print;
run;

 www.signetinfosolutions.com
Thankyou All…

SAS Interview Qstn – 1

A SAS qstn for practice…

a sas data set contains 2 vars. (id & product) as follows:
______________________________

1102       bike101pulsar

1103         bike1064cbz
1104         bike1953discover
1105         bike4756apache
1106        car369city
1107         car34399wagonR
1108         car675verito
1109          car989alto
__________________________

Write a SAS code to create 3 different variables from the above product variable:

ex:   bike101pulsar  =>  bike,  101,  pulsar

===============================

try it…

u can check for ans tmrw..

arvind,

signetinfosolutions,

marathahalli, bangalore – 37

080-65476020