<?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 Why does &amp;quot;dread&amp;quot; cut off last character of filename? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-does-quot-dread-quot-cut-off-last-character-of-filename/m-p/826639#M326511</link>
    <description>&lt;P&gt;I am trying to get the names of all files (including file extension) that are contained in an Azure Data Lake and put them in a table using a loop that goes through the directory. My code can successfully get all the files, starting at a user-supplied base directory, and store their names using the "dread" &lt;STRONG&gt;but it cuts off the last character&lt;/STRONG&gt;. How do I get the full name (including extension) without the last character missing? I don't understand why the last character is cut off. I have tried different files, file types, folders, and all combinations thereof.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code is below along with screenshots of what's contained in ADLS and the "files" table I am storing the output of the code in. Notice that the table has "ds_0" instead of "ds_0&lt;STRONG&gt;1&lt;/STRONG&gt;" and "process.cs" instead of "process.cs&lt;STRONG&gt;v&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Images: (Left) Azure Data Lake Container, (Right) SAS table with filenames&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="7f218312-a3d2-4034-abde-574087c85fc2.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74006iD5B3B5C1FB076772/image-size/small?v=v2&amp;amp;px=200" role="button" title="7f218312-a3d2-4034-abde-574087c85fc2.png" alt="7f218312-a3d2-4034-abde-574087c85fc2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="b065b66e-996a-440b-8aef-5d0c34abd228.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74007i63B5336E2B37A484/image-size/small?v=v2&amp;amp;px=200" role="button" title="b065b66e-996a-440b-8aef-5d0c34abd228.png" alt="b065b66e-996a-440b-8aef-5d0c34abd228.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options azuretenantid = "###-###-###-";

%let appId="###-###-###-";
%let acctName="###";
%let filesys="###";

filename d adls "/"
   applicationId=&amp;amp;appId 
   accountname=&amp;amp;acctName 
   filesystem=&amp;amp;filesys;

data files;

	folder_id = dopen("d");
	put folder_id=;

	num_files = dnum(folder_id);
	put num_files=;

	do i = 1 to num_files;
		length name $256 ;
		name=dread(folder_id,i);
		output;
	end;

	closerc = dclose(folder_id);
	put closerc=;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2022 14:14:47 GMT</pubDate>
    <dc:creator>stf5018</dc:creator>
    <dc:date>2022-08-02T14:14:47Z</dc:date>
    <item>
      <title>Why does "dread" cut off last character of filename?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-quot-dread-quot-cut-off-last-character-of-filename/m-p/826639#M326511</link>
      <description>&lt;P&gt;I am trying to get the names of all files (including file extension) that are contained in an Azure Data Lake and put them in a table using a loop that goes through the directory. My code can successfully get all the files, starting at a user-supplied base directory, and store their names using the "dread" &lt;STRONG&gt;but it cuts off the last character&lt;/STRONG&gt;. How do I get the full name (including extension) without the last character missing? I don't understand why the last character is cut off. I have tried different files, file types, folders, and all combinations thereof.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code is below along with screenshots of what's contained in ADLS and the "files" table I am storing the output of the code in. Notice that the table has "ds_0" instead of "ds_0&lt;STRONG&gt;1&lt;/STRONG&gt;" and "process.cs" instead of "process.cs&lt;STRONG&gt;v&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Images: (Left) Azure Data Lake Container, (Right) SAS table with filenames&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="7f218312-a3d2-4034-abde-574087c85fc2.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74006iD5B3B5C1FB076772/image-size/small?v=v2&amp;amp;px=200" role="button" title="7f218312-a3d2-4034-abde-574087c85fc2.png" alt="7f218312-a3d2-4034-abde-574087c85fc2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="b065b66e-996a-440b-8aef-5d0c34abd228.png" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74007i63B5336E2B37A484/image-size/small?v=v2&amp;amp;px=200" role="button" title="b065b66e-996a-440b-8aef-5d0c34abd228.png" alt="b065b66e-996a-440b-8aef-5d0c34abd228.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options azuretenantid = "###-###-###-";

%let appId="###-###-###-";
%let acctName="###";
%let filesys="###";

filename d adls "/"
   applicationId=&amp;amp;appId 
   accountname=&amp;amp;acctName 
   filesystem=&amp;amp;filesys;

data files;

	folder_id = dopen("d");
	put folder_id=;

	num_files = dnum(folder_id);
	put num_files=;

	do i = 1 to num_files;
		length name $256 ;
		name=dread(folder_id,i);
		output;
	end;

	closerc = dclose(folder_id);
	put closerc=;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 14:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-quot-dread-quot-cut-off-last-character-of-filename/m-p/826639#M326511</guid>
      <dc:creator>stf5018</dc:creator>
      <dc:date>2022-08-02T14:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why does "dread" cut off last character of filename?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-quot-dread-quot-cut-off-last-character-of-filename/m-p/826651#M326515</link>
      <description>&lt;P&gt;I would open a ticket with SAS support.&amp;nbsp;&amp;nbsp;&lt;A href="https://support.sas.com/en/technical-support/submit-a-support-request.html" target="_blank"&gt;https://support.sas.com/en/technical-support/submit-a-support-request.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 14:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-quot-dread-quot-cut-off-last-character-of-filename/m-p/826651#M326515</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-02T14:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why does "dread" cut off last character of filename?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-does-quot-dread-quot-cut-off-last-character-of-filename/m-p/826668#M326520</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-does-quot-dread-quot-cut-off-last-character-of-filename/m-p/826668#M326520</guid>
      <dc:creator>stf5018</dc:creator>
      <dc:date>2022-08-02T15:41:14Z</dc:date>
    </item>
  </channel>
</rss>

