BookmarkSubscribeRSS Feed
ericykc
Fluorite | Level 6

ericykc_0-1698680805433.png

this is the output, and i want to put the final count and the hhid in the same row. May anyone teach me? Thank a lot.

Here my code,

 

data Member;
infile '~/MS3251/Raw Data/Surref.txt' dlm=',';
input dummy_var : $15. @;
if substr(dummy_var,1,1) ^in (0:9) then do;
input @1 hhid : $15. hhtype $;
no_count = 0;
retain dummy_var;
end;
else do;
no_count + 1;
if no_count > 0 then do;
input @1 birthdate : date11. householder_ind $ gender : $6. martial_status : $8. education employment_status $ income ;
if gender='Male' then no_males+1;
mem = no_count;
keep hhid hhtype mem no_count birthdate no_males;
end;
end;
run;

1 REPLY 1
ballardw
Super User

Data and what you expect the result to look like.

Put where? in a data set? A report? What sort of report?

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 322 views
  • 0 likes
  • 2 in conversation