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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1110 views
  • 0 likes
  • 2 in conversation