Good Morning,
I try to copy a template xlsx file from a shared depository on sharepoint to another one on sharepoint. Then i would like to wrote data into the newly copied excel file.
Here is the code that I try, but sas keep erroring and disconnect from the server without giving me an error code :
/* Inpath et outpath */
filename _INPATH WEBDAV "http://sharepoint/dia/Demandes/DIA_3489/3_Developpement/TEMPLATE_EXCEL.xlsx"
user = "xxxxx"
pass ="xxx";
filename _OUTPATH WEBDAV "http://sharepoint/dia/Demandes/DIA_3489/3_Developpement/Ind_Renouv.xlsx"
user = "xxxxx"
pass ="xxx";
DATA _NULL_;
INFILE _INPATH;
INPUT CAR $CHAR1. @@;
FILE _OUTPATH;
PUT CAR $CHAR1. @@;
RUN;
LIBNAME WORKBOOK XLSX _OUTPATH;
/* code to put sas database in excel here */
FILENAME _OUTPATH CLEAR;
FILENAME _INPATH CLEAR;
LIBNAME WORKBOOK CLEAR;
Thanks for your time and help!
Have you tried the FCOPY function?
Have you tried the FCOPY function?
Thanks a lot ChrisNZ
I tried this and it worked fine :
DATA _NULL_;
LENGTH msg $ 384;
rc=fcopy('_INPATH','_OUTPATH');
if rc=0 then
put 'Copied SRC to DEST,';
else do;
mdg=sysmsg();
put rc= msg=;
end;
RUN;
Have a good day!
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.