Skip to content

Instantly share code, notes, and snippets.

@abhishekdagarit
Last active September 23, 2017 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhishekdagarit/2125ddfb321f8854dc3f4cb861397e22 to your computer and use it in GitHub Desktop.
Save abhishekdagarit/2125ddfb321f8854dc3f4cb861397e22 to your computer and use it in GitHub Desktop.
Global statements in SAS

Global statements in SAS

List of global statements in SAS

  1. title
  2. options
  3. footnote

Properties of global statements in SAS

  1. Run once and stays for session of the model.
  2. Can be overwritten. To overwrite, simply redefine.
  3. Can have max 10 titles.
proc print data=work.test;
run;
title `this is my 1st title`;
title2 `this is my second title`;
title3 `this is my third title`;
title4 `this is my fourth title`'
title5 `this is my fifth title`;
title6 `this is my sixth title`;
title7 `this is my seventh title`;
title8 `this is my eighth title`;
title9 `this is my ninth title`;
title10 `this is my tenth title`;
title5 `this is my new fifth title`;

proc print data=work.test;
run;

In the code above

  1. Title was defined once and then overwritten.
  2. titles can be defined max 10 times.
  3. redefining removes the previous one.

Clearing previous title title;

proc means data=work.test;
run;

title ;

footnote

footnote `asdfnkjsadfkjasdf`;
proc print data=work.test;
run;

Clearing footnote

footnote ;
proc print data=work.test;
run;

Options

Removing date

options nodate;
proc print data=work.test;
run;

Removing page number

options nodate nonumber;
proc print data=work.test;
run;

Show page number and date

options date number;
proc print data=work.test;
run;

Start after a particular page number

options number pageno=100;
proc print data=work.test;
run;

Starts with the next page number after the one mentioned.

The code above start from page number 101

Page number error

options number pageno=0;
proc print data=work.test;
run;

The code above gives error as the page number can not be zero. But why the fuck not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment