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.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
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
  • 4 replies
  • 2454 views
  • 0 likes
  • 3 in conversation