<?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: Transposing to wide format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872114#M344548</link>
    <description>&lt;P&gt;The aid and bid may change sequence or we can have more members to add, such as cid. Yes- all the id variables will have identical source.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Apr 2023 05:38:03 GMT</pubDate>
    <dc:creator>bayzid</dc:creator>
    <dc:date>2023-04-26T05:38:03Z</dc:date>
    <item>
      <title>Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872076#M344520</link>
      <description>&lt;P&gt;How can i transpose the following long data to the wide format?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data long;
input var $ value source;
cards;
aid 45 1
bid 46 1
aid 47 1
bid 48 1
aid 45 2
bid 46 2
aid 47 2
bid 48 2
; run;

data wide;
input aid bid source;
cards;
45 46 1
47 48 1
45 46 2
47 48 2
; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 00:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872076#M344520</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T00:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872113#M344547</link>
      <description>&lt;P&gt;Is it always a sequence of "aid" followed by "bid", containing identical values for source?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 05:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872113#M344547</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T05:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872114#M344548</link>
      <description>&lt;P&gt;The aid and bid may change sequence or we can have more members to add, such as cid. Yes- all the id variables will have identical source.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 05:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872114#M344548</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T05:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872119#M344552</link>
      <description>&lt;P&gt;So you must first define a clear rule for detecting the moment where you write a wide observation and reset the values of RETAINed variables to missing. Without an identifier for corresponding input observations, you can't use PROC TRANSPOSE, you'll need some tricky DATA step programming.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 05:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872119#M344552</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T05:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872124#M344557</link>
      <description>&lt;P&gt;The data came from appending multiple JSON files. For each source there are same number of aid and bid.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 06:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872124#M344557</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T06:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872126#M344559</link>
      <description>&lt;P&gt;But the issue here is that the combinations of source and var are not unique, so you need another rule which identifies the "groups" that should constitute a single wide observation.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 06:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872126#M344559</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T06:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872129#M344562</link>
      <description>&lt;P&gt;Yes- that's the challenge. The id variables are not unique within the group of by variables. Can something be done using array?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 06:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872129#M344562</guid>
      <dc:creator>BayzidurRahman</dc:creator>
      <dc:date>2023-04-26T06:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872131#M344564</link>
      <description>&lt;P&gt;Defining the&lt;EM&gt; rule&lt;/EM&gt; must be done by&amp;nbsp;&lt;U&gt;you&lt;/U&gt; before we can start to&amp;nbsp;&lt;EM&gt;code&lt;/EM&gt;.&amp;nbsp;&lt;U&gt;You&lt;/U&gt; must define the logic first.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 06:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872131#M344564</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T06:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872142#M344568</link>
      <description>&lt;P&gt;We need to have a row identifier as a combination of var set and source as shown below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data long;
input var $ value source row;
cards;
aid 45 1 1
bid 46 1 1
aid 47 1 2
bid 48 1 2
aid 45 2 3
bid 46 2 3
aid 47 2 4
bid 48 2 4
; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 07:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872142#M344568</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T07:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872150#M344571</link>
      <description>&lt;P&gt;Do you already have that row identifier?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 07:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872150#M344571</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T07:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872160#M344572</link>
      <description>&lt;P&gt;No.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 08:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872160#M344572</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T08:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872163#M344574</link>
      <description>&lt;P&gt;Then what would be the rule (in plain words) for assigning it?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 08:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872163#M344574</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T08:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872173#M344577</link>
      <description>&lt;P&gt;As one can see in my last dataset, unique number should be assigned&amp;nbsp; for each new repeat of the var and source.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 09:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872173#M344577</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T09:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872233#M344592</link>
      <description>&lt;P&gt;This needs some tricky code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data long;
input var $ value source;
cards;
aid 45 1
bid 46 1
aid 47 1
bid 48 1
aid 45 2
bid 46 2
aid 47 2
bid 48 2
;

proc sql noprint;
select distinct var into :columns separated by " " from long;
quit;
%put &amp;amp;columns;
%macro wide;

data wide;
set long;
by source;
array c {*} &amp;amp;columns;
retain
%do i = 1 %to %sysfunc(countw(&amp;amp;columns));
  %scan(&amp;amp;columns,&amp;amp;i)
%end;
;
if first.source then call missing(of c{*});
select (var);
%do i = 1 %to %sysfunc(countw(&amp;amp;columns));
  when ("%scan(&amp;amp;columns,&amp;amp;i)") do;
    if %scan(&amp;amp;columns,&amp;amp;i) ne .
    then do;
      output;
      call missing(of c{*});
    end;
    %scan(&amp;amp;columns,&amp;amp;i) = value;
  end;
%end;
end;
if last.source and (
%do i = 1 %to %sysfunc(countw(&amp;amp;columns));
  %if &amp;amp;i ne 1 %then or;
  %scan(&amp;amp;columns,&amp;amp;i) ne .
%end;
)
then output;
drop var value;
run;

%mend;

%wide&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 12:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872233#M344592</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T12:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872241#M344598</link>
      <description>&lt;P&gt;Thanks for your time to generate the code. It works for numeric data with short length. But my actual data is a mixture of character and long integer and it doesn't work well.&lt;/P&gt;&lt;P&gt;My data:&lt;/P&gt;&lt;DIV class=""&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs var value source row123456789101112 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;aid&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;bid&lt;/TD&gt;&lt;TD&gt;1494141000168105&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;cid&lt;/TD&gt;&lt;TD&gt;1494131000168101&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;aid&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;bid&lt;/TD&gt;&lt;TD&gt;1494131000168659&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;cid&lt;/TD&gt;&lt;TD&gt;1494131000168333&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;aid&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;bid&lt;/TD&gt;&lt;TD&gt;2154131000168101&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;cid&lt;/TD&gt;&lt;TD&gt;88794131000168101&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;aid&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;bid&lt;/TD&gt;&lt;TD&gt;1598731000168101&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;cid&lt;/TD&gt;&lt;TD&gt;1489751000168101&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;when i use your code the resulting wide table looks like:&lt;/P&gt;&lt;DIV class=""&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs source row aid bid cid1234 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;1.4941E15&lt;/TD&gt;&lt;TD&gt;1.4941E15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;1.4941E15&lt;/TD&gt;&lt;TD&gt;1.4941E15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;2.1541E15&lt;/TD&gt;&lt;TD&gt;8.8794E16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;1.5987E15&lt;/TD&gt;&lt;TD&gt;1.4898E15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If i use proc transpose with source and row variables in the by statement it works fine. Thus I just need help to generate the row variable.&lt;/P&gt;&lt;DIV class=""&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs source row aid bid cid1234 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;1494141000168105&lt;/TD&gt;&lt;TD&gt;1494131000168101&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;1494131000168659&lt;/TD&gt;&lt;TD&gt;1494131000168333&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;2154131000168101&lt;/TD&gt;&lt;TD&gt;88794131000168101&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;11a3fc66-1f44-4421-bad5-7b0f053a8a19&lt;/TD&gt;&lt;TD&gt;1598731000168101&lt;/TD&gt;&lt;TD&gt;1489751000168101&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Apr 2023 13:33:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872241#M344598</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T13:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872305#M344621</link>
      <description>&lt;P&gt;What is the RULE that says when to wrap them?&lt;/P&gt;
&lt;P&gt;Do you just want to take pairs?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data long;
  input var $ value source;
cards;
aid 45 1
bid 46 1
aid 47 1
bid 48 1
aid 45 2
bid 46 2
aid 47 2
bid 48 2
; 

data long_pairs;
  set long;
  group + (1=mod(_n_,2));
run;

proc transpose data=long_pairs out=wide(drop=_name_);
  by group source;
  id var;
  var value;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;OBS    group    source    aid    bid

 1       1         1       45     46
 2       2         1       47     48
 3       3         2       45     46
 4       4         2       47     48
&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 15:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872305#M344621</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-26T15:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872309#M344623</link>
      <description>Go back and check the JSON files. Maybe you shouldn't be working with the all data files but different files. Or there should be something that identifies each group uniquely. Or if it's from different files you can add in each file name.</description>
      <pubDate>Wed, 26 Apr 2023 16:19:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872309#M344623</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-04-26T16:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872372#M344661</link>
      <description>&lt;P&gt;The file name is being saved in the Master_&amp;amp;group datasets but that is not enough to uniquely identify the rows to reshape into wide. The JSON files do not have any column as row identifier but it appears on the left of each file as shown below (1-6).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bayzid_0-1682540736295.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83263i19F05E621B4E2F19/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bayzid_0-1682540736295.png" alt="bayzid_0-1682540736295.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We need to find some way to import that information from each file as a new column in the Master_&amp;amp;group dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 20:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872372#M344661</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T20:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872380#M344664</link>
      <description>In JSON the brackets denote the series of information and group it, which is why I'm suggesting you look at the json mapped data and see if a different file has the data in the format you need.&lt;BR /&gt;&lt;BR /&gt;Those numbers are just line numbers in the text editor. And if you changed the view you could change the line numbers. It's not something you can rely on.</description>
      <pubDate>Wed, 26 Apr 2023 20:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872380#M344664</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-04-26T20:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing to wide format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872382#M344665</link>
      <description>&lt;P&gt;The rule is each appearance of all the distinct values in var by source. If we have 3 distinct values in var then the last digit needs to be 3 to convert into long_pair. Thus, we need to find out the number of distinct values in "var" for each dataset.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data long;
input var $ value $36. source row;
cards;
aid 11a3fc66-1f44-4421-bad5-7b0f053a8a19 1 1
bid 1494141000168105                     1 1
cid 1494131000168101                     1 1
aid 11a3fc66-1f44-4421-bad5-7b0f053a8a19 1 2
bid 1494131000168659                     1 2
cid 1494131000168333                     1 2
aid 11a3fc66-1f44-4421-bad5-7b0f053a8a19 2 3
bid 2154131000168101                     2 3
cid 88794131000168101                    2 3
aid 11a3fc66-1f44-4421-bad5-7b0f053a8a19 2 4
bid 1598731000168101                     2 4
cid 1489751000168101                     2 4
; run;

data long_pairs;
  set long;
  group + (1=mod(_n_,3));
run;

proc transpose data=long_pairs out=wide(drop=_name_);
  by group source;
  id var;
  var value;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am trying to avoid to find out the number of distinct values.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 20:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transposing-to-wide-format/m-p/872382#M344665</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-04-26T20:51:48Z</dc:date>
    </item>
  </channel>
</rss>

