5

Is it possible to allocate a SAS script or macro to a Toolbar button in Base SAS? ie can you 'dm' a macro or sas script?

Allan Bowe
  • 12,306
  • 19
  • 75
  • 124

1 Answers1

6

Certainly. Here is one way:

  1. Go to Tools->Customize.
  2. Select the Customize Tab
  3. Create a new blank button by clicking the "Add Tool" (left most button, right above the word "command"
  4. Select an icon for the new button using the "change icon" button (otherwise it will be blank and won't show up in the toolbar)
  5. To have the button submit a compiled macro, type this in the command field (substituting your macro name of course):

    %nameofmacro;run;

  6. To have the button submit an external sas file, you would put something like this in the command field instead:

    %include "C:\path-to-file\name-of-program.sas";run;

  7. Put whatever you want in the help text and tip text fields

  8. Click OK then save
cmjohns
  • 4,465
  • 17
  • 21
  • I placed a macro within a file;added %include ..../ Then I get a message "Error:Two or more commands start with 'dm';Please reenter" (within the macro I use dm). How can I solve this? Thank you – Bogdan Lataianu Aug 04 '13 at 05:03
  • i think that creates only keyboard macro file (a macro with commands), not any sas program http://www2.sas.com/proceedings/sugi28/240-28.pdf – Bogdan Lataianu Aug 04 '13 at 07:38
  • I managed to do it using gsubmit and include as in here http://www.phusewiki.org/docs/2011%20Papers/PP02%20paper.pdf – Bogdan Lataianu Aug 04 '13 at 08:23