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

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

Settings program:

 %let myvar="HELLO WORLD!"; 

Program "Program":

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

Overview

+6
source share
3 answers

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

  • Right click Settings ,
  • select Link Settings to... ,
  • and select Program in the dialog box.
  • Run Process Flow And watch how Hello World will be printed in a magazine.
+4
source

I think you are looking for the %include function.

You will need to save "Settings" as a standalone program on your server, for example, "/myserver/somefolder/settings.sas".

Then you can verify that it is running through:

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

The program will work just as if you had copied the contents of "settings.sas" into the current program.

+2
source

In addition to the Flow process, you can also create an ordered list. This allows you to run programs in the same process thread in several different orders (or run a subset of the process thread).

You create this in the New → Ordered List, then add programs to it, move them up / down in the desired order. Then you see the ordered list on the left in the project tree and you can right-click to launch it (or select F8).

There is no macro to run a program in enterprise management; you can use automation through .NET if you want to do something like this. Chris Hemedinger at SAS Dummy has a good EG Automation article.

+2
source

Source: https://habr.com/ru/post/985339/


All Articles