Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:58:39+00:00 2026-06-11T21:58:39+00:00

I’ve got a macro that I’ve created on my local machine in a .sas

  • 0

I’ve got a macro that I’ve created on my local machine in a .sas file. I’ve also got a local dataset that have been using to test the macro. This dataset has the same descriptors as a remote dataset, but just less observations. Now, I’m trying to run my local macro against the remote dataset. Here is basically what I have:

This works as expected:

%include "C:\my_sas_macro.sas";

%my_sas_macro(my_data=work.localdata)

but then this generates an error (error follows):

%include "C:\my_sas_macro.sas";

rsubmit;
%my_sas_macro(my_data=remotelib.remotedata)
endrsubmit;

The log with error:

125  %include "C:\my_sas_macro.sas";
136
137  rsubmit;
NOTE: Remote submit to REMOTEID.__7551 commencing.
WARNING: Apparent invocation of macro MY_SAS_MACRO not resolved.
83   %my_sas_macro(my_data=remotelib.remotedata)
     -
     180
ERROR 180-322: Statement is not valid or it is used out of proper order.
84   endrsubmit;

NOTE: Remote submit to REMOTEID.__7551 complete.

I’m pretty sure I need to somehow transfer the %macro/%mend block over to the server, but I can’t figure out how. I’ve seen the %SYSLPUT but that is for macro variables and not full macros.

Is there anyway that I can run my macro on the server without having to just SSH over the code and %include it there?

Thanks!

[Edit] Implemented Solution

So based on @CarolinaJay65 ‘s answer I came up with the following macro which is working pretty well for me so far.

%macro include_on_server(file=);
%let server_file = ~/temp.sas;
%SYSLPUT macro_file=&file;
%SYSLPUT server_file = &server_file;

rsubmit;

proc upload
    infile= "&macro_file."
    outfile= "&server_file."
; run;

%include "&server_file.";
endrsubmit;

%mend include_on_server;

This allows me to just call %include_on_server(file="C:\my_file.sas") and then it’s now included in my remote session.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:58:41+00:00Added an answer on June 11, 2026 at 9:58 pm

    How about using Proc Upload

     rsubmit;
     Proc Upload
      infile='C:\my_sas_macro.sas'
      outfile='//server/my_sas_macro.sas' ;
     run;
    
     %include '//server/my_sas_macro.sas';
     %my_sas_macro(my_data=remotelib.remotedata)
    

    or you could assign the entire macro to a macro variable then use %syslput

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.