Hi i have a list of files that i import using my macro, inside this macro there is also data step that I want to use my tables names to extract months and years and add them to those tables, so i used the substr function, but i receive this error for each iteration NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
26:1 26:1
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
26:9
NOTE: Variable Jan20 is uninitialized.
NOTE: Invalid second argument to function SUBSTR at ligne 65483 colonne 223. Here is my code : %let rep = \\sfdrza\QQQ\adkjf\AAA\BBB\CCC\sdsdt\DDD
%let y20 = Jan20 Feb20;
/*Import*/
options msglevel=I;
options mprint;
%macro boucle_doCC(in);
%local i s;
%do i=1 %to %sysfunc(countw(&in.,%str( )));
%let s&i.=%scan(&in.,&i.,%str( ));
proc import datafile ="&rep.\&&s&i...xlsx"
out=&&s&i..
dbms=xlsx replace;
getnames=yes;
run;
data &&s&i..(keep= Brand Segment DC Trade:);
set &&s&i..;
if missing(Brand) then delete;
/*ajout des colonnes mois et année*/
year=substr(&&s&i.,-1, 2);
month=substr(&&s&i..,1, 3);
run;
%end;
%mend boucle_doCC;
... View more