BookmarkSubscribeRSS Feed
gdok
Calcite | Level 5
Hi all,

Pretty new SAS user here and I have search around (google) for this answer but i cant seem to find a good explanation. Can someone give me a hand and take 1 min to reply.

In the following code:
DATA _NULL_ ;
CALL SYMPUT ( 'n_obs' , put ( n_obs, 5. ) ) ;
STOP ;
SET dsname nobs = n_obs;
RUN ;

What does the '5' represent and what is it function?

Thanks!
5 REPLIES 5
martha_sas
SAS Employee
The "5." is a numeric format. It says that the output field should have a width of 5. You should always look first in the SAS documentation instead of Google. To learn about the format, look in Base SAS: SAS Language Reference: Dictionary: Dictionary of Language Elements: Formats, for the "w.d" numeric format. Next learn about the "PUT function" that is using that format, by looking in Base SAS: SAS Language Reference: Dictionary: Dictionary of Language Elements: Functions and CALL Routines for "PUT function".
gdok
Calcite | Level 5
thank you very much for the time. I will work on the better research methods you describe! 🙂
martha_sas
SAS Employee
You're welcome. You may want to read the documentation for the "CALL SYMPUT Routine", also in the "Functions and CALL Routines" section.
martha_sas
SAS Employee
I may have been wrong to assume you have documentation available. Do you have anything? What do you get when you use the SAS Help menu? I am not much help if I tell you to look in documentation that you don't have.
gdok
Calcite | Level 5
I was able to find all the references you suggested online. They all start with the address support.sas.com/documentation.

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
  • 5 replies
  • 891 views
  • 0 likes
  • 2 in conversation