BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Would that be possible to assign a format to the value by using Symput (or similarly in PROC SQL).

Here is an example:
PROC SQL noprint;
select min(EN) into :minEN;
from test;
QUIT;

The minimum value of EN is 10.12345. The above program works perfectly to get the exact value but can I assign a format like COMMA8.2 to change it to 10.12?
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
With the DATA step approach and SYMPUT, you would use the PUT function in the SYMPUT call to generate a "formatted" value. And with the PROC SQL approach, the FORMAT= keyword is added to the SELECT to generate a formatted value.

Scott Barry
SBBWorks, Inc.
Flip
Fluorite | Level 6
PROC SQL noprint;
select put(min(EN), comma8.2) into :minEN;
from test;
QUIT;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 740 views
  • 0 likes
  • 3 in conversation