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?

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 384 views
  • 0 likes
  • 2 in conversation