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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 601 views
  • 0 likes
  • 3 in conversation