<?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: data manipulation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370893#M88570</link>
    <description>&lt;P&gt;Transpose and then set X number of times, though not sure why you would A) want this structure, and B) want to repeat the same data lots of times?&lt;/P&gt;
&lt;PRE&gt;proc transpose data=have out=want;
  by col1;
  var col2;
run;
data want;
  set want want want want want;
run;&lt;/PRE&gt;
&lt;P&gt;Also, when posting test data in the form of a datastep, it should really be runnable, what you post doesn't really help as doesn't show structure.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2017 12:44:50 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-06-27T12:44:50Z</dc:date>
    <item>
      <title>data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370890#M88569</link>
      <description>&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;How to perfume that esealy without using iml&amp;nbsp;?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;q&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2&lt;/P&gt;&lt;P&gt;w&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.3&lt;/P&gt;&lt;P&gt;e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.4&lt;/P&gt;&lt;P&gt;r&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5&lt;/P&gt;&lt;P&gt;t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6&lt;/P&gt;&lt;P&gt;y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;q&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11&lt;/P&gt;&lt;P&gt;0.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11&lt;/P&gt;&lt;P&gt;0.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11&lt;/P&gt;&lt;P&gt;0.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11&lt;/P&gt;&lt;P&gt;0.2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.11&lt;/P&gt;&lt;P&gt;... n time the sames lines, n&amp;nbsp;known.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 12:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370890#M88569</guid>
      <dc:creator>DoumbiaS</dc:creator>
      <dc:date>2017-06-27T12:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370893#M88570</link>
      <description>&lt;P&gt;Transpose and then set X number of times, though not sure why you would A) want this structure, and B) want to repeat the same data lots of times?&lt;/P&gt;
&lt;PRE&gt;proc transpose data=have out=want;
  by col1;
  var col2;
run;
data want;
  set want want want want want;
run;&lt;/PRE&gt;
&lt;P&gt;Also, when posting test data in the form of a datastep, it should really be runnable, what you post doesn't really help as doesn't show structure.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 12:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370893#M88570</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-27T12:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370897#M88572</link>
      <description>&lt;P&gt;Use call execute off dataset have:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name $ value;
cards;
q        0.2
w       0.3
e        0.4
r        0.5
t        0.6
y       0.11
;
run;

%let n=5;

data _null_;
set have end=done;
if _n_ = 1 then call execute('data want;');
call execute(strip(name) !! ' = ' !! put(value,best.) !! ';');
if done then call execute("do i = 1 to &amp;amp;n; output; end; drop i; run;");
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jun 2017 12:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370897#M88572</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-27T12:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370909#M88577</link>
      <description>&lt;P&gt;Many thanks !&lt;BR /&gt;When using proc template, get an error msg.&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;BR /&gt;612&amp;nbsp; proc transpose data=have out=want;&lt;BR /&gt;613&amp;nbsp;&amp;nbsp;&amp;nbsp; by col1;&lt;BR /&gt;ERROR: Variable COL1 introuvable.&lt;BR /&gt;614&amp;nbsp;&amp;nbsp;&amp;nbsp; var col2;&lt;BR /&gt;615&amp;nbsp; run;&lt;BR /&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;Also as n is very high, will have to "set want" hundreds of times&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370909#M88577</guid>
      <dc:creator>DoumbiaS</dc:creator>
      <dc:date>2017-06-27T13:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370912#M88579</link>
      <description>&lt;P&gt;Thanks, works very well with call execute !&lt;/P&gt;&lt;P&gt;Could suggest a smart update if n is the number of rows in data have ?&lt;/P&gt;&lt;P&gt;That is 6 in this case. Always without using iml.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370912#M88579</guid>
      <dc:creator>DoumbiaS</dc:creator>
      <dc:date>2017-06-27T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370917#M88580</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/80356"&gt;@DoumbiaS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, works very well with call execute !&lt;/P&gt;
&lt;P&gt;Could suggest a smart update if n is the number of rows in data have ?&lt;/P&gt;
&lt;P&gt;That is 6 in this case. Always without using iml.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use _n_ to automatically get the number:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set have end=done;
if _n_ = 1 then call execute('data want;');
call execute(strip(name) !! ' = ' !! put(value,best.) !! ';');
if done then call execute("do i = 1 to " !! put(_n_,best.) !! "; output; end; drop i; run;");
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370917#M88580</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-27T13:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370921#M88582</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;B Regards&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370921#M88582</guid>
      <dc:creator>DoumbiaS</dc:creator>
      <dc:date>2017-06-27T13:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: data manipulation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370936#M88586</link>
      <description>&lt;P&gt;Sorry, can't find any google search results on:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ERROR: Variable ___&amp;nbsp;introuvable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;??&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;From your post however, again the question arises, why do you want hundreds of the same data? &amp;nbsp;This doesn't make any sense to me? &amp;nbsp;I mean you can do it, just have something like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want;
  set sashelp.class (keep=name age);
  do rowid=1 to 10;
    output;
  end;
run;
proc sort data=want;
  by rowid name;
run;
proc transpose data=want out=want;
  by rowid;
  var age;
  id name;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;But all that is doing is taking some data and multiplying its storage factor up by 10 for no gain?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 13:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-manipulation/m-p/370936#M88586</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-27T13:59:20Z</dc:date>
    </item>
  </channel>
</rss>

