data new_dsn;
retain city name age sex;
set given_dsn;
if src = ‘P’ then name = c_n;
retain city ;
if src = ‘H’ then city =c_n;
if src = ‘P’;
drop c_n src;
run;
proc print;
run;
cheers,
arvind dama.
Month: September 2012
data new_dsn;
retain city name age sex;
set given_dsn;
if src = ‘P’ then name = c_n;
retain city ;
if src = ‘H’ then city =c_n;
if src = ‘P’;
drop c_n src;
run;
proc print;
run;
cheers,
arvind dama.
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
1102 bike101pulsar
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