BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
P3T3R_NFLLAB
Calcite | Level 5

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!

1 ACCEPTED SOLUTION
2 REPLIES 2
P3T3R_NFLLAB
Calcite | Level 5

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!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1281 views
  • 1 like
  • 2 in conversation