<?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 resulted in COL1 with some unexpected results in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634679#M77995</link>
    <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;.</description>
    <pubDate>Wed, 25 Mar 2020 10:31:51 GMT</pubDate>
    <dc:creator>sahoositaram555</dc:creator>
    <dc:date>2020-03-25T10:31:51Z</dc:date>
    <item>
      <title>Proc transpose resulted in COL1 with some unexpected results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634663#M77989</link>
      <description>&lt;P&gt;data a;&lt;/P&gt;
&lt;P&gt;input subjid visitc sodium potassium bicarbonate glucose bloodureanitrogen creatinine SGPT SGOT GGT;&lt;/P&gt;
&lt;P&gt;cards;&lt;/P&gt;
&lt;P&gt;01001 3th_visit 12.2 34.2 33.2 33 22 123 90 89 89.3&lt;/P&gt;
&lt;P&gt;01001 6th_visit 22.3 41.6 56.1 89 12 133 80 49 39.3&lt;/P&gt;
&lt;P&gt;01001 9th_visit 20.2 40.2 23.2 23 12 230 30 99 19.3&lt;/P&gt;
&lt;P&gt;01002 3th_visit 13.2 41.2 12.2 13 43 634 65 14 23.2&lt;/P&gt;
&lt;P&gt;01002 6th_visit 90.2 21.2 33.2 33 22 123 90 89 89.3&lt;/P&gt;
&lt;P&gt;01002 9th_visit 29.2 34.2 30.2 13 12 126 30 29 99.3&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when i transpose this by below code:&lt;/P&gt;
&lt;P&gt;proc transpose data=a out=t_a name=variables ;&lt;BR /&gt;by subjid visit;&lt;BR /&gt;var sodium--ggt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have an output similar to below where COL1 is getting a length of 5000 and the values which i can't use for any of the derivation , neither i can use any function to extract the value. example if i use a cat function or compress function to reduce the length or even i tried by assigning a lesser length by mentioning it before set statement so that PDV get the shorter length but it's not working. i have tried to apped the value to nother variable, but its putting missing value there as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;subjid&amp;nbsp; visit variables _Label_ COL1&lt;/P&gt;
&lt;P&gt;01001 3th_visit sodium 3rdweekvisit&amp;nbsp; 12.2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ANyone who has ever faced this issue kindly do shoot a reply.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634663#M77989</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-03-25T10:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose resulted in COL1 with some unexpected results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634675#M77994</link>
      <description>&lt;P&gt;I cannot recreate your issue. When I run this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input subjid visitc sodium potassium bicarbonate glucose bloodureanitrogen creatinine SGPT SGOT GGT;
cards;
01001 3th_visit 12.2 34.2 33.2 33 22 123 90 89 89.3
01001 6th_visit 22.3 41.6 56.1 89 12 133 80 49 39.3
01001 9th_visit 20.2 40.2 23.2 23 12 230 30 99 19.3
01002 3th_visit 13.2 41.2 12.2 13 43 634 65 14 23.2
01002 6th_visit 90.2 21.2 33.2 33 22 123 90 89 89.3
01002 9th_visit 29.2 34.2 30.2 13 12 126 30 29 99.3
;

proc transpose data=a out=t_a name=variables ;
by subjid visitc;
var sodium--ggt;
run;

proc contents data=t_a;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get this result:&lt;/P&gt;
&lt;PRE&gt;Alphabetische Liste der Variablen und Attribute
#	Variable	Typ	Länge	Etikett
4	COL1	Num	8	 
5	COL2	Num	8	 
6	COL3	Num	8	 
1	subjid	Num	8	 
3	variables	Char	17	NAME DER FRÜHEREN VARIABLE
2	visitc	Num	8	 
&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634675#M77994</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-25T10:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose resulted in COL1 with some unexpected results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634679#M77995</link>
      <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;.</description>
      <pubDate>Wed, 25 Mar 2020 10:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634679#M77995</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-03-25T10:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose resulted in COL1 with some unexpected results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634683#M77996</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/109034"&gt;@sahoositaram555&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/109034"&gt;@sahoositaram555&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;... COL1 is getting a length of 5000 ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;This indicates that the variable list&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;sodium--ggt&lt;/FONT&gt; contains a character variable&lt;/SPAN&gt; (of length 5000). In this case all transposed numeric values will be converted to character values of that maximum length (which will be mentioned in the log: "&lt;FONT face="courier new,courier"&gt;NOTE: Numeric variables in the input data set will be converted to character in the output data set.&lt;/FONT&gt;").&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;First, check if&amp;nbsp;&lt;FONT face="courier new,courier"&gt;sodium&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;potassium&lt;/FONT&gt; etc. are numeric variables. If so (and you want COL1 to be numeric as well), restrict the variable list to numeric variables:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var sodium-numeric-ggt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Please note that this will exclude all character variables. If need be, you may want to transpose these in a separate PROC TRANSPOSE step.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634683#M77996</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-25T10:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose resulted in COL1 with some unexpected results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634701#M77998</link>
      <description>&lt;P&gt;So you first need to follow Maxim 3 and get to Know Your Data. Once you have determined the culprit, you need to go searching why a column that you expected to be numeric ended up being character of length 5000.&lt;/P&gt;
&lt;P&gt;This is usually the result of an unsound import process (read: using proc import, or - gasp - Excel files). The proper way to be about it is to fix that import process. Replace Excel files with text-based files, and use a proper data step to read the data into SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 11:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634701#M77998</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-25T11:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose resulted in COL1 with some unexpected results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634772#M78014</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/109034"&gt;@sahoositaram555&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have an output similar to below where COL1 is getting a length of 5000&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means that SOMETHING in your data is text. The maximum length a numeric variable will have in SAS is 8.&lt;/P&gt;
&lt;P&gt;So apparently your example data step does not reflect the actual data you may be attempting to transpose.&lt;/P&gt;
&lt;P&gt;Perhaps it is time to run proc contents on the actual data set you are attempting to transpose and show us the result descriptions of the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 14:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-transpose-resulted-in-COL1-with-some-unexpected-results/m-p/634772#M78014</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-25T14:35:19Z</dc:date>
    </item>
  </channel>
</rss>

