BookmarkSubscribeRSS Feed
yogita_patel
Calcite | Level 5

Hi, 

How can I get the output for values as like compare value. Because of the alignment in value my proc compare report is showing mismatch value. I want output like compare value

can someone help me please?

 

yogita_patel_0-1654810171874.png

 

4 REPLIES 4
Reeza
Super User
Show your code for how you created Base Values, assuming that's the one that you want changed.
yogita_patel
Calcite | Level 5


data adae_com3;
set adae_com2;
length col2 col3 col7 $25.;
col2 = strip (C1002) ||' '|| strip(put(round(input(C1002,best.)*100/&n02,0.1),perc.));
col3 = strip (C1005) ||' '|| strip(put(round(input(C1005,best.)*100/&n05,0.1),perc.));
col7 = strip (total) ||' '|| strip(put(round(input(total,best.)*100/&nt,0.1),perc.));

run;

ballardw
Super User

@yogita_patel wrote:


data adae_com3;
set adae_com2;
length col2 col3 col7 $25.;
col2 = strip (C1002) ||' '|| strip(put(round(input(C1002,best.)*100/&n02,0.1),perc.));
col3 = strip (C1005) ||' '|| strip(put(round(input(C1005,best.)*100/&n05,0.1),perc.));
col7 = strip (total) ||' '|| strip(put(round(input(total,best.)*100/&nt,0.1),perc.));

run;


You are missing some details such as values of macro variables &n02, &n05, &nt, example values for variables C1002, C1005 and Total, the definition for the custom format PERC, and some actual desired results for provided values of C

Reeza
Super User
Can you share some input data and the perc format?

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1281 views
  • 0 likes
  • 3 in conversation