<?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: Need Help with a Transpose in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-with-a-Transpose/m-p/636394#M78111</link>
    <description>&lt;P&gt;Another way to achieve what you want is with the untranspose macro. e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ut url 'http://tiny.cc/untranspose_macro';
%include ut ;
%untranspose(data=tab1, out=tab2 (drop=num rename=(net=NETWORK)), id=num,
  var=net, copy=provider_NPI--city)

data tab2(drop=hold);
  retain network;
  set tab2;
  hold=hmob_be_num;
  call missing (of hmob: care: mapo:);
  if network='HMOB' then hmob_be_num=hold;
  else if network='CARE' then care_be_num=hold;
  else if network='MAPO' then mapo_be_num=hold;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2020 22:14:15 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2020-03-31T22:14:15Z</dc:date>
    <item>
      <title>Need Help with a Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-with-a-Transpose/m-p/636328#M78105</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to transpose one record that I am having hard time.&amp;nbsp; An excel sheet with 2 TABS is attached.&amp;nbsp; &amp;nbsp;TAB1 is the record I want to transpose.&amp;nbsp; TAB2 is what I need.&amp;nbsp; &amp;nbsp; I also created corresponding datasets.&amp;nbsp; Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 14:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-with-a-Transpose/m-p/636328#M78105</guid>
      <dc:creator>asabou01</dc:creator>
      <dc:date>2020-04-01T14:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-with-a-Transpose/m-p/636384#M78110</link>
      <description>&lt;P&gt;I suspect that your example data is incomplete but for what you show this gets the values you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Data want;
	length network $ 5; /* needs to be at least as long as the longest NET value*/

   set tab1;
	array n net1-net5;
	array nums hmob_be_num care_be_num mapo_be_num;
	array copy {3} $ 14 ;/* length is longest of the _num variables*/
	/* make copies of the _num variables*/
	do i=1 to dim(nums);
		copy[i]=nums[i];
	end;
	/* clear out NUMs */
	call missing (of nums(*));
   do i = 1 to dim(n);
		Network = n[i];
		select (n[i]);
			when ('HMOB') do; hmob_be_num = copy[1];
			                 output;
								  call missing(hmob_be_num);
			             end;
			when ('CARE') do; care_be_num = copy[1];
			                 output;
								  call missing(care_be_num);
			             end;
			when ('MAPO') do; mapo_be_num = copy[1];
			                 output;
								  call missing(mapo_be_num);
			             end;
			when ('252','P') output;
			otherwise put "WARNING: Unexpected value for Network " network=;
		end;
	end;
	drop i net1-net5 copy1-copy3;
run;&lt;/PRE&gt;
&lt;P&gt;I generally don't worry about the specific column numbers variables end up in as I can control the output in any report needed that might want a specific layout.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-with-a-Transpose/m-p/636384#M78110</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-31T21:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with a Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-Help-with-a-Transpose/m-p/636394#M78111</link>
      <description>&lt;P&gt;Another way to achieve what you want is with the untranspose macro. e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ut url 'http://tiny.cc/untranspose_macro';
%include ut ;
%untranspose(data=tab1, out=tab2 (drop=num rename=(net=NETWORK)), id=num,
  var=net, copy=provider_NPI--city)

data tab2(drop=hold);
  retain network;
  set tab2;
  hold=hmob_be_num;
  call missing (of hmob: care: mapo:);
  if network='HMOB' then hmob_be_num=hold;
  else if network='CARE' then care_be_num=hold;
  else if network='MAPO' then mapo_be_num=hold;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 22:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-Help-with-a-Transpose/m-p/636394#M78111</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2020-03-31T22:14:15Z</dc:date>
    </item>
  </channel>
</rss>

