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: 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
  • 2 replies
  • 705 views
  • 0 likes
  • 3 in conversation