BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Hello,

 

I would like to know how to call a macro on  a Unix server (see the macro below)

 

%macro Transferbookibnrtodev(dev=,cie=,yyyy=,mm=);

libname source spde "/dwh_actuariat/sasdata/sas2020/&cie.";
libname dest spde "/dwh_actuariat/sasdata/sas2020&dev./&cie.";

proc copy in=source out=dest;

select &cie._bookibnr_&yyyy.&mm.;

 

If we need to make a ksh file , please provide an example

Regards,

run;

libname source clear;
libname dest clear;

/*Example of call: %Transferbookibnrtodev(dev=5,cie=golf ,yyyy=2020,mm=10);*/

%mend Transferbookibnrtodev;

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Not sure why you need a shell script.  To run a program from the command line first save the SAS code into a file. It is normal to use .sas as the extension on the file.  Then from the command prompt you type the command sas (or whatever command your systems team created to run sas) followed by the name of the file.  If you don't include the .sas extension SAS will add it.

sas myprogram

The result will be a file named myprogram.log and possible a file named myprogram.lst written in the current directory.

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

SAS macros run the same way regardless of operating system.

 

You define the macro first then call it:

%macro MyMacro;

< statements>

%mend MyMacro;

%MyMacro;
Tom
Super User Tom
Super User

Not sure why you need a shell script.  To run a program from the command line first save the SAS code into a file. It is normal to use .sas as the extension on the file.  Then from the command prompt you type the command sas (or whatever command your systems team created to run sas) followed by the name of the file.  If you don't include the .sas extension SAS will add it.

sas myprogram

The result will be a file named myprogram.log and possible a file named myprogram.lst written in the current directory.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1003 views
  • 0 likes
  • 3 in conversation