简体   繁体   中英

How to call one macro program from another in SAS Enterprise Guide?

Is there any macro command that allows calling one program from another (the %run_program() pseudo code)?

Program "Settings":

%let myvar="HELLO WORLD!";

Program "Program":

%run_program(Settings); *Pseudo-code;
%put &myvar; *Should print *Should print "HELLO WORLD!";

概观

This is not exact answer on your question, but if you only want to be sure that Settings is run before Program when Run Process Flow you can link them together.

  1. Right click Settings ,
  2. choose Link Settings to... ,
  3. and pick Program from the dialog.
  4. Run Process FLow And see the Hello World be printed in the log.

I think that you are looking for the %include function.

You would have to save 'Settings' as a stand-alone program on your server like '/myserver/somefolder/settings.sas'.

Then you could ensure that it is run via:

...some code
%include ('/myserver/somefolder/settings.sas');
... more code

The program would run exactly as it would if you copy-pasted the contents of 'settings.sas' into the current program.

In addition to the Process Flow, you also can create an Ordered List. This allows you to run programs in a single process flow in multiple different orders (or run a subset of a process flow).

You create that in New -> Ordered List, then Add programs to it, move them up/down in the order you want. Then you see the ordered list on the left in the project tree and can right click to run it (or select then F8).

There is not a macro command to run a program in enterprise guide; you can use automation via .NET if you want to do things like that. Chris Hemedinger on The SAS Dummy has a good article on EG automation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM