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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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