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!

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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