%sysfunc

by Irina 22. May 2007 06:40

%sysfunc :

%sysfunc is useful for retrieving information about datasets, changing column attributes and formatting macro variables.One primary difference between calling a function in %SYSFUNC and elsewhere in the SAS System is this last notion of applying a format to the results of a function call.

Example1.

footnote finished: %sysfunc (today(), date9. );

Example2.

%put %sysfunc (PutN(&Salary,dollar12.));

Example3.

%put With a salary of
%sysfunc (PutN(&Salary,dollar12.));
%put You are %sysfunc(PutN(&salary, income.));

Example4.

If you wanted to find the total number of observations in a dataset and store that number as a macro variable. You might use something like this:

%let dsid= %sysfunc (open(name of the data));
%let nvars= %sysfunc (attrn(&dsid,nlobs));
%put &nvars; 
 

Tags: %sysfunc, macro

SAS | macro

Comments

10/8/2011 4:17:50 AM

Thank you for sharing, I really enjoyed your posts and pictures they were great! I think that all of us who follow this blog have that same feeling that you got from visiting.

beijing youth hostels

Add comment


(will show your Gravatar icon)  





Live preview

2/5/2012 8:23:12 PM

 

About the author

Irina Spivak Irina Spivak
Team Leader at G-Stat. More...


Send mail Email

Blogroll

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2012

    Sign in

    eXTReMe Tracker