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;
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 macros run the same way regardless of operating system.
You define the macro first then call it:
%macro MyMacro;
< statements>
%mend MyMacro;
%MyMacro;
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.