<?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: Insert text into all cells of first column in a sas dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270631#M53803</link>
    <description>&lt;P&gt;There's the INDSNAME option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you you planning to append the files? If so, something like the following should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data moments_all;
Set moments_1 - moments_237 indsname=source;

Dataset_source = source;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 May 2016 07:08:30 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-05-16T07:08:30Z</dc:date>
    <item>
      <title>Insert text into all cells of first column in a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270629#M53802</link>
      <description>&lt;P&gt;I've output 'Moments' from Proc Univariate to datasets. &amp;nbsp;Many.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: &amp;nbsp;Moments_001.sas7bdat through to&amp;nbsp;&lt;SPAN&gt;Moments_237.&lt;/SPAN&gt;&lt;SPAN&gt;sas7bdat&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the first column of each dataset (new added first column, and probably&amp;nbsp;new dataset, as opposed to the original) I would like to have a particular text in every cell going down to bottom row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The exact text would be the name of the respective dataset file: say, "&lt;SPAN&gt;Moments_001".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I do not have to 'grab' the filename, per se, if that's not possible. &amp;nbsp;As I know what the names are already, I can put that text into the procedure. &amp;nbsp;However, grabbing the filenames, if possible, would be easier from my standpoint.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'd greatly appreciate any help anyone could provide to accomplish this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Nicholas Kormanik&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 06:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270629#M53802</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-05-16T06:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Insert text into all cells of first column in a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270631#M53803</link>
      <description>&lt;P&gt;There's the INDSNAME option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you you planning to append the files? If so, something like the following should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data moments_all;
Set moments_1 - moments_237 indsname=source;

Dataset_source = source;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 May 2016 07:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270631#M53803</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-16T07:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Insert text into all cells of first column in a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270641#M53804</link>
      <description>&lt;P&gt;Why have you created hundreds of datasets? &amp;nbsp;One of the prime benefits of SAS is that it allows you to process datasets using by groups - hence one dataset can contain many by groups. &amp;nbsp;This is both faster (open file once), and far simpler to work with. &amp;nbsp;My suggestion is to look at the process up to an including the univariate, and fix that so you have one dataset to work with.&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 08:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270641#M53804</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-05-16T08:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Insert text into all cells of first column in a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270666#M53813</link>
      <description>&lt;P&gt;To make your new variable appear as the first column, also add a LENGTH statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN&gt; moments_all&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="token keyword"&gt;length dataset_source $ 32;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt;&lt;SPAN&gt; moments_1 &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt; moments_237 indsname&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;source&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;dataset_source &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; source&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token procnames"&gt;The LENGTH statement must come before the SET statement for this to work properly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 11:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-text-into-all-cells-of-first-column-in-a-sas-dataset/m-p/270666#M53813</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-05-16T11:12:47Z</dc:date>
    </item>
  </channel>
</rss>

