<?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 Obtaining a row of key from a transpose file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800676#M315023</link>
    <description>&lt;P&gt;Greetings everyone,&lt;/P&gt;&lt;P&gt;I got this file after transpose but only need to keep one row of key. I know proc sort can delete duplicates but I need the items stay the same order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data example;&lt;/P&gt;&lt;P&gt;input ID $ Item105 $ Item124 $ Item 992 $ Item020 Item 035 $ Item 021 Item025 Item789;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;001 A B . 1 D . 1 A&lt;/P&gt;&lt;P&gt;002 .&amp;nbsp; B C 1 . 1 . A&lt;/P&gt;&lt;P&gt;003 . . C 1 D 1 1 A&lt;/P&gt;&lt;P&gt;004 A . . 1 D . 1 A&amp;nbsp;&lt;/P&gt;&lt;P&gt;005 . . C . D 1 1 .&lt;/P&gt;&lt;P&gt;006 A B . . D 1 . A&lt;/P&gt;&lt;P&gt;007 A B . 1 . 1 . A&lt;/P&gt;&lt;P&gt;008 . . C 1 D . . A&lt;/P&gt;&lt;P&gt;009 A . C . . 1 . .&lt;/P&gt;&lt;P&gt;010 . . . 1 D 1 1 A&lt;/P&gt;&lt;P&gt;011 . B C . D 1 . A&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;input ID $ Item105 $ Item124 $ Item 992 $ Item020 Item 035 $ Item 021 Item025 Item789;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;001 A B C 1 D 1 1 A&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How will I be able to achieve this? Thank you so much in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 15:38:27 GMT</pubDate>
    <dc:creator>lapetitemaman</dc:creator>
    <dc:date>2022-03-07T15:38:27Z</dc:date>
    <item>
      <title>Obtaining a row of key from a transpose file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800676#M315023</link>
      <description>&lt;P&gt;Greetings everyone,&lt;/P&gt;&lt;P&gt;I got this file after transpose but only need to keep one row of key. I know proc sort can delete duplicates but I need the items stay the same order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data example;&lt;/P&gt;&lt;P&gt;input ID $ Item105 $ Item124 $ Item 992 $ Item020 Item 035 $ Item 021 Item025 Item789;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;001 A B . 1 D . 1 A&lt;/P&gt;&lt;P&gt;002 .&amp;nbsp; B C 1 . 1 . A&lt;/P&gt;&lt;P&gt;003 . . C 1 D 1 1 A&lt;/P&gt;&lt;P&gt;004 A . . 1 D . 1 A&amp;nbsp;&lt;/P&gt;&lt;P&gt;005 . . C . D 1 1 .&lt;/P&gt;&lt;P&gt;006 A B . . D 1 . A&lt;/P&gt;&lt;P&gt;007 A B . 1 . 1 . A&lt;/P&gt;&lt;P&gt;008 . . C 1 D . . A&lt;/P&gt;&lt;P&gt;009 A . C . . 1 . .&lt;/P&gt;&lt;P&gt;010 . . . 1 D 1 1 A&lt;/P&gt;&lt;P&gt;011 . B C . D 1 . A&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;input ID $ Item105 $ Item124 $ Item 992 $ Item020 Item 035 $ Item 021 Item025 Item789;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;001 A B C 1 D 1 1 A&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How will I be able to achieve this? Thank you so much in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 15:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800676#M315023</guid>
      <dc:creator>lapetitemaman</dc:creator>
      <dc:date>2022-03-07T15:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining a row of key from a transpose file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800677#M315024</link>
      <description>Sorry, Item789 should be Item789 $.</description>
      <pubDate>Mon, 07 Mar 2022 15:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800677#M315024</guid>
      <dc:creator>lapetitemaman</dc:creator>
      <dc:date>2022-03-07T15:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining a row of key from a transpose file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800684#M315027</link>
      <description>&lt;P&gt;I don't see any transpose here or how transpose would have anything to do with this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you explain the reason you get that value as the output?&lt;/P&gt;
&lt;P&gt;Why does ID='001'?&amp;nbsp; What happens when ITEM105 has values other than 'A' or ' '?&amp;nbsp; Which value would you want?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 16:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800684#M315027</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-07T16:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining a row of key from a transpose file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800689#M315029</link>
      <description>The example file is what I have obtained after transposing another file. There is no transposing here. The values A, B, C, D, and 1 are the correct answers (or key) and each ID were administered different items. The values I want are only one row of values (with no missing value) that I can use as the key file for another program. I can change and rename the first variable after I obtain one row of values.</description>
      <pubDate>Mon, 07 Mar 2022 16:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800689#M315029</guid>
      <dc:creator>lapetitemaman</dc:creator>
      <dc:date>2022-03-07T16:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining a row of key from a transpose file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800696#M315030</link>
      <description>&lt;P&gt;Wouldn't it be easier to get the answer key from the original dataset rather than after you have transposed it?&amp;nbsp; Probably a simple select distinct query in SQL or a PROC SORT NODUPKEY step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could trick the UPDATE function into doing what you want.&amp;nbsp; But you will need some constant value variable to use as the BY variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data step1;
  set example;
  if _n_=1 then dummy=id;
  retain dummy;
run;

data want;
  update step1(obs=0) step1;
  by dummy;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 17:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800696#M315030</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-07T17:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining a row of key from a transpose file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800713#M315039</link>
      <description>The reason I used transpose to get this file is because I had a transposed response file and these two files need to match (in terms of item order, examinee ID order). I wish the item order followed a constant value... Thank you for the help.</description>
      <pubDate>Mon, 07 Mar 2022 18:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Obtaining-a-row-of-key-from-a-transpose-file/m-p/800713#M315039</guid>
      <dc:creator>lapetitemaman</dc:creator>
      <dc:date>2022-03-07T18:25:04Z</dc:date>
    </item>
  </channel>
</rss>

