DATA Step, Macro, Functions and more

Newbie question here

Reply
New Contributor
Posts: 3

Newbie question here

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!
SAS Employee
Posts: 19

Re: Newbie question here

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".
New Contributor
Posts: 3

Re: Newbie question here

thank you very much for the time. I will work on the better research methods you describe! Smiley Happy
SAS Employee
Posts: 19

Re: Newbie question here

You're welcome. You may want to read the documentation for the "CALL SYMPUT Routine", also in the "Functions and CALL Routines" section.
SAS Employee
Posts: 19

Re: Newbie question here

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.
New Contributor
Posts: 3

Re: Newbie question here

I was able to find all the references you suggested online. They all start with the address support.sas.com/documentation.
Ask a Question
Discussion stats
  • 5 replies
  • 175 views
  • 0 likes
  • 2 in conversation