<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683568#M207069</link>
    <description>&lt;P&gt;You don't "terminate" it, you set it to values according to your needs. These are all described in the documentation I linked to.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2020 06:10:30 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-09-14T06:10:30Z</dc:date>
    <item>
      <title>Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683491#M207037</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;What is the way that the names of the new columns will be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Y30_12_19&amp;nbsp; &amp;nbsp;Y30_12_18&amp;nbsp; Y28_08_17&amp;nbsp; &amp;nbsp;Y&lt;CODE class=" language-sas"&gt;26_09_19 &amp;nbsp;&amp;nbsp;Y25_06_18&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;instead&amp;nbsp;of:&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Y30-12-19&amp;nbsp; &amp;nbsp;Y30-12-18&amp;nbsp; Y28-08-17&amp;nbsp; &amp;nbsp;Y&lt;CODE class=" language-sas"&gt;26-09-19 &amp;nbsp;&amp;nbsp;Y25-06-18&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data t;
input cid  date ddmmyy8. flag $;
format date ddmmyy8.;
cards;
1 30-12-19 Y
1 30-12-18 N
1 28-08-17 N
2 26-09-19 Y
2 25-06-18 N
;
Run;

proc transpose data=t out=want(drop=_name_) prefix=Y;
BY CID notsorted;
ID date;
var flag;
Run;
 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Sep 2020 06:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683491#M207037</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-09-13T06:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683492#M207038</link>
      <description>&lt;P&gt;I found solution.&lt;/P&gt;
&lt;P&gt;I will be glad to see more solutions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t2 ;
set t;
date_char=put(date,ddmmyy8.);
DD=scan(date_char,1,"/");
MM=scan(date_char,2,"/");
YYYY=CATS("20",scan(date_char,3,"/"));
date_char_new=catx("_",DD,MM,YYYY);
run;

proc transpose data=t2 out=want (drop=_name_) prefix=Y;
by cid;
id date_char_new;
var flag;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Sep 2020 06:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683492#M207038</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-09-13T06:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683497#M207042</link>
      <description>&lt;P&gt;Set&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=v7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before running the TRANSPOSE, and it will take care of invalid characters on its own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: still using 2-digit years after the Y2K scare is, to be polite, extremely stupid.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;30_12_19&lt;/PRE&gt;
&lt;P&gt;could be December 30, 1919, or December 30, 2019, or (use any other year after 1600 that ends in 19), or December 19, 1930, or December 19, 2030, or (see above);&lt;/P&gt;
&lt;P&gt;Using th standard ISO format E8601DA10. or YYMMDD10. will fix that.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 07:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683497#M207042</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-13T07:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683506#M207047</link>
      <description>&lt;P&gt;May you please give more examples when using&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;options validvarname=v7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it used most in proc transpose or also in summary procs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 10:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683506#M207047</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-09-13T10:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683512#M207048</link>
      <description>&lt;P&gt;Make use of the documentation:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lesysoptsref&amp;amp;docsetTarget=p124dqdk8zoqu3n1r4nsfqu5vx52.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;VALIDVARNAME System Option&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;What comes into play here is a side-effect of the option: before it was introduced, TRANSPOSE had to try its best to make valid SAS names (max 32 characters, can only contain letters, digits and underlines, must start with a letter or underline) out of the contents of the ID variable(s). That's what I forced by setting the option to V7.&lt;/P&gt;
&lt;P&gt;With the usual setting nowadays (ANY), TRANSPOSE can mostly keep what's in the ID variables, so it will rarely make any changes.&lt;/P&gt;
&lt;P&gt;A similar effect exists for PROC IMPORT, where a setting of V7 will also force a conversion to valid SAS names.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2020 12:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683512#M207048</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-13T12:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683565#M207067</link>
      <description>&lt;P&gt;What is the way to close(terminate) the option "options validvarname=v7;" ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 05:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683565#M207067</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-09-14T05:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683568#M207069</link>
      <description>&lt;P&gt;You don't "terminate" it, you set it to values according to your needs. These are all described in the documentation I linked to.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 06:10:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/683568#M207069</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-14T06:10:30Z</dc:date>
    </item>
  </channel>
</rss>

