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.
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!
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.
Ready to level-up your skills? Choose your own adventure.