<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Reading multiple files from Sharepoint to SAS Linux in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-files-from-Sharepoint-to-SAS-Linux/m-p/889472#M351435</link>
    <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am stuck with the logic where i need to automate reading the txt files from sharepoint. The requirement is to pull all the txt files which are available in the Sharepoint folder. I am able to copy and read the files one by one but i need to automate this process. Your idea/suggestions would really help me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code for reading one file :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename outfile "/sasdata/MCS_Change_Notice.txt";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC HTTP&lt;BR /&gt;URL="&lt;A href="https://xxxx.sharepoint.com/teams/xxxx/_api/Web/getfilebyserverrelativeurl('/teams/xxxx/Shared%20Documents/MCS/MCS_Change_Notice.txt')/$value" target="_blank"&gt;https://xxxx.sharepoint.com/teams/xxxx/_api/Web/getfilebyserverrelativeurl('/teams/xxxx/Shared%20Documents/MCS/MCS_Change_Notice.txt')/$value&lt;/A&gt;"&lt;BR /&gt;METHOD="GET" OUT=OUTFILE;&lt;BR /&gt;HEADERS&lt;BR /&gt;"Authorization"="Bearer &amp;amp;access_token."&lt;BR /&gt;"X-RequestDigest"="form digest value"&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA _Read;&lt;BR /&gt;infile "/sasdata/MCS_Change_Notice.txt" truncover delimiter='^' dsd ;&lt;BR /&gt;input stuff $5000.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do we have any method to pull the complete files under sharepoint folder?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if any additional details required.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Aug 2023 09:13:00 GMT</pubDate>
    <dc:creator>saswiki</dc:creator>
    <dc:date>2023-08-16T09:13:00Z</dc:date>
    <item>
      <title>Reading multiple files from Sharepoint to SAS Linux</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-files-from-Sharepoint-to-SAS-Linux/m-p/889472#M351435</link>
      <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am stuck with the logic where i need to automate reading the txt files from sharepoint. The requirement is to pull all the txt files which are available in the Sharepoint folder. I am able to copy and read the files one by one but i need to automate this process. Your idea/suggestions would really help me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code for reading one file :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename outfile "/sasdata/MCS_Change_Notice.txt";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC HTTP&lt;BR /&gt;URL="&lt;A href="https://xxxx.sharepoint.com/teams/xxxx/_api/Web/getfilebyserverrelativeurl('/teams/xxxx/Shared%20Documents/MCS/MCS_Change_Notice.txt')/$value" target="_blank"&gt;https://xxxx.sharepoint.com/teams/xxxx/_api/Web/getfilebyserverrelativeurl('/teams/xxxx/Shared%20Documents/MCS/MCS_Change_Notice.txt')/$value&lt;/A&gt;"&lt;BR /&gt;METHOD="GET" OUT=OUTFILE;&lt;BR /&gt;HEADERS&lt;BR /&gt;"Authorization"="Bearer &amp;amp;access_token."&lt;BR /&gt;"X-RequestDigest"="form digest value"&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA _Read;&lt;BR /&gt;infile "/sasdata/MCS_Change_Notice.txt" truncover delimiter='^' dsd ;&lt;BR /&gt;input stuff $5000.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do we have any method to pull the complete files under sharepoint folder?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if any additional details required.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 09:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-files-from-Sharepoint-to-SAS-Linux/m-p/889472#M351435</guid>
      <dc:creator>saswiki</dc:creator>
      <dc:date>2023-08-16T09:13:00Z</dc:date>
    </item>
  </channel>
</rss>

