<?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: getting row values into column labels in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/getting-row-values-into-column-labels/m-p/837609#M331203</link>
    <description>&lt;P&gt;Provide example data in the form of a data step. We can't write code to use a screen shot.&lt;/P&gt;
&lt;P&gt;Then provide what you expect as a result.&lt;/P&gt;
&lt;P&gt;If your "customerid" values are so sensitive replace them in the example with some different values like XXXX and YYYY or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since a number of SAS procedures will create a variable like _NAME_ in the process it might be that you should share the data from before whatever you have done to create that example and show us the code used to create it. It may be that is the step to do this instead of afterwards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you sure that you need a data set?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Oct 2022 06:56:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-10-10T06:56:25Z</dc:date>
    <item>
      <title>getting row values into column labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-row-values-into-column-labels/m-p/837606#M331201</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the attached screenshot I want to have the values under __NAME__ appended to existing column names:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shuvaya_1-1665381372902.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76041i3692A06AC85F34B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shuvaya_1-1665381372902.png" alt="shuvaya_1-1665381372902.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So output dataset will have only one row for a customer which will have column names snack_net_amount , breakfast_net_amount , snack_num_txns , breakfast_num_txns.&lt;/P&gt;&lt;P&gt;Can someone please help me with this?&lt;/P&gt;&lt;P&gt;I think I am missing something very basic, but since I am new to SAS, can't seem to figure it out.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 05:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-row-values-into-column-labels/m-p/837606#M331201</guid>
      <dc:creator>shuvaya</dc:creator>
      <dc:date>2022-10-10T05:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: getting row values into column labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-row-values-into-column-labels/m-p/837609#M331203</link>
      <description>&lt;P&gt;Provide example data in the form of a data step. We can't write code to use a screen shot.&lt;/P&gt;
&lt;P&gt;Then provide what you expect as a result.&lt;/P&gt;
&lt;P&gt;If your "customerid" values are so sensitive replace them in the example with some different values like XXXX and YYYY or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since a number of SAS procedures will create a variable like _NAME_ in the process it might be that you should share the data from before whatever you have done to create that example and show us the code used to create it. It may be that is the step to do this instead of afterwards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you sure that you need a data set?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:56:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-row-values-into-column-labels/m-p/837609#M331203</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-10T06:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: getting row values into column labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-row-values-into-column-labels/m-p/837636#M331214</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
As ballarwd pointed out.
Make a data step to represent your data,Nodoby would like to type it for you !
*/
data have;
input id name $ snack breakfast;
cards;
1 net_amou 27.97 1
1 num_txns 1  2
2 net_amou 27.97 1
2 num_txns 1  2
;

data temp;
 set have;
 n+1;
run;

proc transpose data=temp out=temp2;
by  n id name;
var  snack breakfast;
run;
proc transpose data=temp2 out=want delimiter=_;
by id;
id _name_ name;
var col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2022 11:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-row-values-into-column-labels/m-p/837636#M331214</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-10T11:34:03Z</dc:date>
    </item>
  </channel>
</rss>

