We are creating a user define format $country:
proc format;
value $country AU='australia'
US='United States'
Ind='India'
Sl='Sri lanka';
run;
A SAS Data set:
data one;
infile datalines;
input location $ population;
format location $country.;
datalines;
AU 1500
US 800
Ind 1000
pak 900
Sl 500
NP 300
;
run;
proc print;
run;
This is the output:
Obs location population
1 australia 1500
2 United States 800
3 India 1000
4 pak 900
5 Sri lanka 500
6 NP 300
In the above scenario we can see that for the observation pak and NP .$country format is not applicable.
Write a program to count the number of observations on which $country (user defined format) is not applied.
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
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
No comments:
Post a Comment