Hello,
It works fine in SAS EG but when I execute the SAS program on Unix server, it failed.
%macro validatinginputds(monthlist, yearlist)/minoperator;
%let cielist=be gc gp ha je nx tr we wc wu;
%let subfolderlist=auto habi entr;
%let loblist=auto prop cna;
%let path=/dwh_actuariat/sasdata/sas&yearlist.;
/****************** beginning of the looping ************/
proc sql;
CREATE TABLE inputds (
cie varchar(2),
lob varchar(11),
subfolder varchar(4),
cpath varchar(100),
filename varchar(50),
NbTx int,
tot_wrtn_prem_amt int
);
quit;
%do h=1 %to %sysfunc(countw(&cielist.));
%if %tslit(%scan(&cielist.,&h)) eq 'je' %then %let value=2;
%else %if %tslit(%scan(&cielist.,&h)) eq 'gc' %then %let value=0;
%else %let value=1;
/*%put &=value;*/
%do i=1 %to %sysfunc(countw(&loblist.))-&value.;
%do k=1 %to %sysfunc(countw(&yearlist.));
%do j=1 %to %sysfunc(countw(&monthlist.));
%let fname=%scan(&cielist.,&h)_%scan(&loblist.,&i)_prm%scan(&monthlist.,&j)%scan(&yearlist.,&k);
%let libnm=/dwh_actuariat/sasdata/sas%scan(&yearlist.,&k)/%scan(&cielist.,&h)/%scan(&subfolderlist.,&i);
%let cie=%scan(&cielist.,&h);
%let lob=%scan(&loblist.,&i);
%let subfolder=%scan(&subfolderlist.,&i);
/* Reading the total number of transactions and the sum of wrtn_prem_amt */
libname src1 spde "&path./&cie./&subfolder.";
proc sql noprint;
insert into inputds
select "&cie." as cie,
"&lob" as lob ,
"&subfolder" as subfolder,
"&path./&cie./&subfolder." as cpath,
"&Fname" as filename ,
count(*) as NbTx ,
coalesce(sum(WRTN_PREM_AMT),0) format=best12. as tot_wrtn_prem_amt
from src1.&fname.;
quit;
/*************************************************************************/
%end;
%end;
%end;
%end;
run;
%mend validatinginputds;
WARNING: Apparent invocation of macro TSLIT not resolved. ERROR: Required operator not found in expression: %tslit(%scan(&cielist.,&h)) eq 'je' ERROR: The macro VALIDATINGINPUTDS will stop executing.
... View more