BookmarkSubscribeRSS Feed
Ayooo1
Obsidian | Level 7

This might be a simple question but I would to replace the blank with a zero, how can I do that? The picture is the data after transposed.

data Merged_CP (keep= DoseC_P EXDSTXT SEX);
set listing2_1;
by EXDSTXT;
retain COUNT PERCENT EXDSTXT SEX;
length DoseC_P $20;
DoseC_P= strip(put(COUNT,comma12.)||''|| put(-PERCENT/100,percent7.1));
run;
proc sort data=Merged_CP;
by SEX;
run;
proc transpose data=Merged_CP out=EXDM (drop=_NAME_);
by SEX;
id EXDSTXT;
var DoseC_P;
run;
proc print data=EXDM;
run;

Ayooo1_0-1671041135114.png

 

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

Obviously, there are way to do this. 

 

However, if your end goal is to simply create a frequency table with percentages, then there are better ways to go.

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!

How to Concatenate Values

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.

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