libname deepak 'C:\SAS Files';
proc format;
invalue convert 'A+' = 100
'A' = 96
'A-' = 92
'B+' = 88
'B' = 84
'B-' = 80
'C+' = 76
'C' = 72
'F' = 65;
data deepak.grades;
input ID $3. Grade convert.;
*format Grade convert. ;
datalines;
001 A-
002 B+
003 F
004 C+
005 A
;

proc print data = deepak.grades;
run;
I get the following output
Obs ID Grade
1 001 .
2 002 .
3 003 .
4 004 .
5 005 .

I don’t understand why Grade shows up as a missing value.
Everything seems fine, including ID $3.
Now, in case I use ID : $3. Or use column input, I get the
desired output.

Kindly help
Deepak

Answer Posted / ramakrishna

proc format;
invalue convert 'A+' = 100
'A' = 96
'A-' = 92
'B+' = 88
'B' = 84
'B-' = 80
'C+' = 76
'C' = 72
'F' = 65;
run;
data grades;
input ID $3. Grade $ convert.;
*format Grade convert. ;
datalines;
001 A-
002 B+
003 F
004 C+
005 A
;

proc print data = grades;
run;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro

578


If a variable contains letters or special characters, can it be numeric data type?

757


describe about metadata object? : Sas-di

621


what do you mean by data staging area? : Sas-di

599


What areas of SAS are you most interested in?

1062






Mention how to limit decimal places for the variable using proc means?

641


what are the component of range? : Sas-bi

616


data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.

1795


How will you generate test data with no input data?

561


is data integration and etl programming is same? : Sas-di

574


What is the use of stop statement?

642


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

624


Have you used macros? For what purpose you have used? : sas-macro

557


What does the trace option do?

662


what is the use of sas management console? : Sas-di

613