<?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 Re: Filename as a variable name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118412#M24419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your "merge" means "stacking", then check out option: indsname= in "set statement"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm"&gt;SAS(R) 9.3 Statements: Reference&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Feb 2013 16:25:32 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2013-02-22T16:25:32Z</dc:date>
    <item>
      <title>Filename as a variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118411#M24418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have around 420 files. The id for the subject is the filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to merge these 420 files as one file and tag the data for each subject with their id. Please could some one suggest, how could I create the filename as a variable (called id) inside the dataset for all the lines inside the dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once this is done, I could data merge the 420 files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SN &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 15:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118411#M24418</guid>
      <dc:creator>SN</dc:creator>
      <dc:date>2013-02-22T15:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filename as a variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118412#M24419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your "merge" means "stacking", then check out option: indsname= in "set statement"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p00hxg3x8lwivcn1f0e9axziw57y.htm"&gt;SAS(R) 9.3 Statements: Reference&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 16:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118412#M24419</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-02-22T16:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filename as a variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118413#M24420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If they are all structured the same they could be read at the same time avoiding the merge with the filename option assigning the value of the file name as a variable &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename myfiles "C:\path\*.csv"; /* or similar depending on your names and extensions*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile myfiles filename= FileRead ; /* and other options needed to read your data*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input ...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 18:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118413#M24420</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-02-22T18:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filename as a variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118414#M24421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks this worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Feb 2013 21:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-as-a-variable-name/m-p/118414#M24421</guid>
      <dc:creator>SN</dc:creator>
      <dc:date>2013-02-24T21:51:21Z</dc:date>
    </item>
  </channel>
</rss>

