No errors here, so please explain what the problem is in a lot more detail.
@ambreen wrote:
see my result in the file attached as mistake
I am not able to assign the values to observations except in gender
u can see if you see my result in file attached above
Many of us don't (or can't) download attachments. Why don't you post the output here in your reply, or better yet, explain the problem to us.
well @ambreen there are to many things wrong to point at just one.
Try this and see if you can find out what you did wrong.
data fda;
*set cdc.hw7;
input gender occupation judgedpreviously age;
cards;
1 1 1 21
1 1 1 48
2 2 1 54
2 1 2 35
;
PROC FORMAT;
VALUE Gender 1= 'Female' 2 = 'Male';
VALUE Occupation 1= 'Mstudent' 2 = 'Nurse' 3-5 = 'Resident' 6-10 = 'Fellow';
VALUE JudgedPreviously 1= 'Yes' 2= 'No';
VALUE Age 20-29 = 'second' 30-39 = 'third' 40 - 49 = 'fourth' 50 - 59 = 'fifth';
RUN;
PROC PRINT DATA= fda ;/*cdc.hw7;*/
FORMAT GENDER GENDER. Occupation Occupation. JudgedPreviously JudgedPreviously. AGE AGE.;
run;
The SAS System
Obs gender occupation judgedpreviously age
1 Female Mstudent Yes second
2 Female Mstudent Yes fourth
3 Male Nurse Yes fifth
4 Male Mstudent No third
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.