<?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: Proc Transpose formtting in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-formtting/m-p/551234#M153142</link>
    <description>&lt;P&gt;If a single step is critical then you need to do it in manual data step. Something like:&lt;/P&gt;
&lt;PRE&gt;data t_ecg3;
   length visit $ 32;  /*&amp;lt;= need to set the length to hold the longest expected value*/
   set t_ecg2 (drop=visit);
   array vl ECGRES1 ECGRES2 ECGRES3;
   do i=1 to dim (vl);
      visit=put(vname(vl[i]),$visit.);
      col1= vl[i];
      output;
   end;
   drop i ECGRES1 ECGRES2 ECGRES3;
run;&lt;/PRE&gt;
&lt;P&gt;One of the very likely headaches in the attempt is the assigned length of your visit variable and whether the placing the formatted version in to the variable would fit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, assigning the FORMAT to the variable _name_ should work for many purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that habitual use of the&lt;/P&gt;
&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;construct will lead to problems figuring out where your logic problem occurred when something goes unexpected. You completely rewrite the data set and cannot get back to the previous version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Apr 2019 20:02:45 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-04-15T20:02:45Z</dc:date>
    <item>
      <title>Proc Transpose formtting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-formtting/m-p/551162#M153114</link>
      <description>&lt;P&gt;Hi, Is there a way I can use Formatting in Proc Transpose procedure to format either _name_ or Col. For example, combine below two steps into one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC TRANSPOSE DATA=ECG_ OUT=T_ECG2(where=(EGABDESC_^="") rename=(col1=EGABDESC_));&lt;BR /&gt;VAR ECGRES1 ECGRES2 ECGRES3;&lt;BR /&gt;BY STUDYID USUBJID visit;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA T_ECG2;&lt;BR /&gt;SET T_ECG2;&lt;BR /&gt;BY STUDYID USUBJID VISIT;&lt;BR /&gt;VISIT=PUT(_NAME_, $VISIT.);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="rangySelectionBoundary" style="line-height: 0; display: none;"&gt;PROC TRANSPOSE DATA=ECG_ OUT=T_ECG2(where=(EGABDESC_^="") rename=(col1=EGABDESC_));&lt;BR /&gt;VAR ECGRES1 ECGRES2 ECGRES3;&lt;BR /&gt;BY STUDYID USUBJID visit;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 18:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-formtting/m-p/551162#M153114</guid>
      <dc:creator>Road_trip</dc:creator>
      <dc:date>2019-04-15T18:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose formtting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-formtting/m-p/551234#M153142</link>
      <description>&lt;P&gt;If a single step is critical then you need to do it in manual data step. Something like:&lt;/P&gt;
&lt;PRE&gt;data t_ecg3;
   length visit $ 32;  /*&amp;lt;= need to set the length to hold the longest expected value*/
   set t_ecg2 (drop=visit);
   array vl ECGRES1 ECGRES2 ECGRES3;
   do i=1 to dim (vl);
      visit=put(vname(vl[i]),$visit.);
      col1= vl[i];
      output;
   end;
   drop i ECGRES1 ECGRES2 ECGRES3;
run;&lt;/PRE&gt;
&lt;P&gt;One of the very likely headaches in the attempt is the assigned length of your visit variable and whether the placing the formatted version in to the variable would fit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, assigning the FORMAT to the variable _name_ should work for many purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that habitual use of the&lt;/P&gt;
&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;construct will lead to problems figuring out where your logic problem occurred when something goes unexpected. You completely rewrite the data set and cannot get back to the previous version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 20:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-formtting/m-p/551234#M153142</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-15T20:02:45Z</dc:date>
    </item>
  </channel>
</rss>

