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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 655 views
  • 0 likes
  • 3 in conversation