BookmarkSubscribeRSS Feed
Rodcjones
Obsidian | Level 7

I am seeking to use the code in this usage note 

http://support.sas.com/kb/40/934.html

but applied to a file that resides within a Sharepoint document library. I took a stab at putting in the http address, like this

 

 

/** Non-macro technique **/

filename fileref 'http://sites/philtest/Shared%20Documents/runs.xlsx';

data a(drop=fid);

infile fileref truncover obs=1;

fid=fopen('fileref');

Bytes=finfo(fid,'File Size (bytes)');

crdate=finfo(fid,'Create Time');

moddate=finfo(fid,'Last Modified');

run;

proc print; run;

 

 

But I get the error

ERROR: A component of C:\sas\sasconfig\Lev1\SASApp\http:\\sites\philtest\Shared%20Documents\runs.xlsx is not
a directory.

 

I would welcome any hints on how to adjust my code to get this to work. Thanks!

 

I am using SAS 9.04 TS1M6  EG 7.1 

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

You need to specify a device type. URL in your case.

It's all in the documentation.

See here.

ScottBass
Rhodochrosite | Level 12

And if you get the device type working, this macro may give you some code ideas, even if you don't use the macro itself:

 

https://github.com/scottbass/SAS/blob/master/Macro/dirlist.sas


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
Rodcjones
Obsidian | Level 7

I'm still unable to get it to work -- same error -- despite using URL. My best guess at this point is that AUTHODOMAIN= might be needed to get me through to the site (which is an on-prem SharePoint document library). Still working on it.

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 16. 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
  • 4 replies
  • 822 views
  • 0 likes
  • 3 in conversation