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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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