Desktop productivity for business analysts and programmers

how to include macros which are in local server in my SAS program and run the program in a remote server?

Reply
Contributor
Posts: 70

how to include macros which are in local server in my SAS program and run the program in a remote server?

We have a set of standard Macros in our local server. I wonder how to include these macros in my SAS program and run the program in remote server? thanks

Respected Advisor
Posts: 4,132

Re: how to include macros which are in local server in my SAS program and run the program in a remote server?

If I understand your question right then you're using mp-connect (rsubmit blocks).

If so then below link should answer your question: http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/viewer.htm#a002590516.htm

Super User
Super User
Posts: 6,843

Re: how to include macros which are in local server in my SAS program and run the program in a remote server?

%SYSLPUT (and the reverse %SYSRPUT) will work for macro variables.

Super User
Super User
Posts: 6,843

Re: how to include macros which are in local server in my SAS program and run the program in a remote server?

You could upload the source code for the macro definition and then either %INC it or autosource it.

filename local 'local path';

rsubmit;

filename remote 'remote path';

proc upload infile=local('xxx.sas') outfile=remote('xxx.sas') status=n; run;

%inc remote('xxx.sas');

...

Do they change frequently?  If not then just copy them to the remote server once and point to them the same way that you point to them on your local SAS sessions.

Contributor
Posts: 70

Re: how to include macros which are in local server in my SAS program and run the program in a remote server?

Thanks Tom and Patrick.

What we don't want is to keep two copies of macros (one in local PC, the other one is in remote UNIX server). Instead we prefer to keep only one set of macros in our local machine to facilitate the management. I didn't try the proc upload yet, but just wonder whether there is any other better way to implement it.

PROC Star
Posts: 1,291

Re: how to include macros which are in local server in my SAS program and run the program in a remote server?

Hi,

One option is to run Samba on the UNIX server.  I haven't administered it, but as a user the end result is that the autocall library is sitting on the Unix box, but in windows you can map a drive to it.

So the macro definitions might sit in /autocall

And your PC config.sas would point to Q:/autocall.

That worked great (only gotcha is that on unix, the filenames in the autocall library have to be lowcase!).

I don't have Samba where I'm set up now, so agree it would be nice to have a solution for this.  Currently I just copy files from Windos to Unix when I update the macro library, which isn't that often....

--Q.

Ask a Question
Discussion stats
  • 5 replies
  • 1319 views
  • 6 likes
  • 4 in conversation