BookmarkSubscribeRSS Feed
DLROW
Quartz | Level 8

Hi , I am trying to populate the value in the proc report statment but it is not working. Please advise.

 

min weight = 30

max weight = 40

 

Proc sql;

select MIn(weight) , Max(weight) into :MinWeight, :Maxweight

from table1;

quit;

 

Proc report data = final;

columns A B C

("Min 30"  Name ("Activity" Amount Percent) ("May" Result)

When I use concatenating funtion it is not working. I want the minWeight to be populated when the report runs..

("Min " || "&MinWeight" Name ("Activity" Amount Percent) ("May" Result) . 

6 REPLIES 6
Reeza
Super User
You don't need the concatenation operator here at all, just drop it and it should work fine.
learsaas
Quartz | Level 8

Proc report data = final nowd;
columns A B C
("Min &MinWeight" Name ("Activity" Amount Percent) ("May" Result))
;
run;

DLROW
Quartz | Level 8
Thank you. It works but I get lot of space between Min and Minweight.
It is like
Min 30
Please let me know how can this space be reduced.
DLROW
Quartz | Level 8
Min ( lot if space) 30
Reeza
Super User
Look up the TRIMMED option when creating macro variables.
learsaas
Quartz | Level 8

Proc report data = final nowd;
columns A B C
("Min %left(&MinWeight)" Name ("Activity" Amount Percent) ("May" Result))
;
run;

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
  • 6 replies
  • 1875 views
  • 1 like
  • 3 in conversation