<?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: How to put title as content into column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78251#M16940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I see that this makes sense. However, I still don't know how to solve my problem. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Mar 2013 12:27:34 GMT</pubDate>
    <dc:creator>Marian_2127</dc:creator>
    <dc:date>2013-03-15T12:27:34Z</dc:date>
    <item>
      <title>How to put title as content into column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78249#M16938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the title says, I'm looking for a way to take the name of a column and put it into each field of this column as content.&lt;BR /&gt;There are more than 600 data sets where this has to be done so doing it manually is not an option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I describe the problem a little more in detail:&lt;/P&gt;&lt;P&gt;- I have 600 csv's&lt;/P&gt;&lt;P&gt;- I 'infile' them with a makro&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;- each of the corresponding 600 data sets has a title like ' _lib.list_openings_number1_number2'&amp;nbsp;&amp;nbsp;&amp;nbsp; [for example ' _lib.list_openings_5016_5249434' ]&lt;/P&gt;&lt;P&gt;- I need these numbers as a content of a column named (for example) Origin&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Later, I will have to merge all of the 600 sets so I need a column that makes it possible to tell for each set where it comes from.)&lt;/P&gt;&lt;P&gt;- I tried it with&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Origin = scan(&amp;amp;&amp;amp;dat&amp;amp;i ,2 ,'_');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(where dat&amp;amp;i= %scan(&amp;amp;dat,&amp;amp;i,%str( ));&lt;/P&gt;&lt;P&gt;and dat = openings_1372_4975528 openings_1372_4979553 ......(600 csv's) ...openings_5016_5249434 )&lt;/P&gt;&lt;P&gt;(More code's attached)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But this gives me two columns, one named Origin with no filling at all, and one named openings_5016_5249434 with only . as a content in each field. Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So both, telling me how to take a title and put in into each field of the column, or telling me how to create 'Origin' correctly in the first place, will solve my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd be really happy if somebody could help me &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Marina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 09:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78249#M16938</guid>
      <dc:creator>Marian_2127</dc:creator>
      <dc:date>2013-03-15T09:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to put title as content into column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78250#M16939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For starters, you are using the data step function scan (opposed to the corresponding macro function), some you have to either have a column name, or a char constant as first argument, not just unquoted plain text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 12:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78250#M16939</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-03-15T12:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to put title as content into column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78251#M16940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I see that this makes sense. However, I still don't know how to solve my problem. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 12:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78251#M16940</guid>
      <dc:creator>Marian_2127</dc:creator>
      <dc:date>2013-03-15T12:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to put title as content into column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78252#M16941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not really sure on what is your problem.&lt;/P&gt;&lt;P&gt;What happens if you fix the syntax?&lt;/P&gt;&lt;P&gt;But on the other hand, it seems cumbersome to list all files you want to import in the macro call.&lt;/P&gt;&lt;P&gt;If you can assume that all file in a certain directory should be imported, get a directory listing into a SAS table (you could use filename pipe with dir/ls).&lt;/P&gt;&lt;P&gt;Then loop through the table and do call execute the macro using the filename as a parameter. I guess that would make the macro coding easier - no need for %do %while %scan...stuff...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 12:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78252#M16941</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-03-15T12:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to put title as content into column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78253#M16942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thank you so much!&lt;/P&gt;&lt;P&gt;I was obviously just a little confused about macro/non-macro.&lt;/P&gt;&lt;P&gt;It's working fine now :smileygrin:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(Thanks for the hint about reading everything in the folder instead of listing the names - I will definitely try that, too.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 13:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-title-as-content-into-column/m-p/78253#M16942</guid>
      <dc:creator>Marian_2127</dc:creator>
      <dc:date>2013-03-15T13:06:50Z</dc:date>
    </item>
  </channel>
</rss>

