Libname Libsas 'E:\libsas\Itop';
Filename FichCsv2 'O:\Sc-Performance\PFI\ITOP\input_data\SCCM\Itop_Extraction_SCCM2012_lab.csv' ENCODING="utf-8";
%macro import_csv(outf,outds);
%put outf=&outf;
%let filrf=myfile;
%put filrf=&filrf;
%if %sysfunc(fileexist(&outf)) %then %do;
%let rc=%sysfunc(filename(filrf,&outf));
%let fid=%sysfunc(fopen(&filrf));
%if &fid > 0 %then %do;
%let rc=%sysfunc(fread(&fid));
%let rc=%sysfunc(fget(&fid,mystring));
%let rc_close=%sysfunc(fclose(&fid));
%if &rc = 0 %then %do;
proc import file="&outf." out=&outds
DBMS=DLM REPLACE;
Delimiter=';';
Guessingrows=32767;
Getnames=Yes;
run;
%end;
%else %do;
%put Fichier &outf. importation impossible fichier vide.;
Data _NULL_;
Date = today();
Format Date yymmdd10.;
File Sortie Notitles Mod;
put @50 "En date du: " Date +(-1)"," /;
put @10 "Le fichier &outf est vide.";
run;
%end;
%end;
%let rc=%sysfunc(filename(filrf));
%end;
%else %put fichier existe pas;
%mend import_csv;
%import_csv(O:\Sc-Performance\PFI\ITOP\input_data\SCCM\Itop_Extraction_SCCM2012_lab.csv,Libsas.ItopSCCMLAB);
*%import_csv("&Fich2.",Libsas.ItopSCCMLAB); Can not pass the filename with encoding. is there a way to pass him the filename or some other way because I have to keep the encoding.
... View more