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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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