<?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: Taking a Single column of data and splitting it into several columns based on the subtitles. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626955#M77489</link>
    <description>Thank you for your help - it works perfectly...&lt;BR /&gt;</description>
    <pubDate>Mon, 24 Feb 2020 18:38:00 GMT</pubDate>
    <dc:creator>MVanderkloot</dc:creator>
    <dc:date>2020-02-24T18:38:00Z</dc:date>
    <item>
      <title>Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626871#M77483</link>
      <description>&lt;P&gt;I have an Excel file with this list - except it is 10,000 rows&lt;/P&gt;&lt;P&gt;----sas-eg-cca-full----&lt;BR /&gt;wlo&lt;BR /&gt;knak&lt;BR /&gt;votte&lt;BR /&gt;khu&lt;BR /&gt;sdza&lt;BR /&gt;pdeb&lt;BR /&gt;bmc&lt;BR /&gt;chnel&lt;BR /&gt;jell&lt;BR /&gt;mghe&lt;BR /&gt;alleb&lt;BR /&gt;----sas-eg-hcs-chaps-full----&lt;BR /&gt;cmat&lt;BR /&gt;obri&lt;BR /&gt;----sas-eg-dca-phe-read----&lt;BR /&gt;hswe&lt;BR /&gt;----sas-eg-fnihbabr-ship-read----&lt;BR /&gt;iagm&lt;BR /&gt;grwn&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Final dataset would be:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;wlo&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sas-eg-cca-full&lt;BR /&gt;knak&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sas-eg-cca-full&lt;BR /&gt;votte&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sas-eg-cca-full&lt;BR /&gt;khu&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sas-eg-cca-full&lt;BR /&gt;sdza&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sas-eg-cca-full&lt;BR /&gt;pdeb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sas-eg-cca-full&lt;BR /&gt;bmc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-cca-full&lt;BR /&gt;chnel&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-cca-full&lt;BR /&gt;jell&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-cca-full&lt;BR /&gt;mghe&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;sas-eg-cca-full&lt;BR /&gt;alleb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-cca-full&lt;BR /&gt;cmat&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-hcs-chaps-full&lt;BR /&gt;obri&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-hcs-chaps-full&lt;BR /&gt;hswe&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-dca-phe-read&lt;BR /&gt;iagm&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-fnihbabr-ship-read&lt;BR /&gt;grwn&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sas-eg-fnihbabr-ship-read&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks MARK&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 14:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626871#M77483</guid>
      <dc:creator>MVanderkloot</dc:creator>
      <dc:date>2020-02-24T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626880#M77484</link>
      <description>What have you tried so far?</description>
      <pubDate>Mon, 24 Feb 2020 15:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626880#M77484</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2020-02-24T15:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626884#M77485</link>
      <description>&lt;P&gt;I have checked the community for Ideas - but couldn't find anything - so I don't know what to try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626884#M77485</guid>
      <dc:creator>MVanderkloot</dc:creator>
      <dc:date>2020-02-24T15:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626899#M77486</link>
      <description>You need to identify the pattern and logic you're trying to achieve.  Maybe keep the field as the 2nd column if it starts with '--'...</description>
      <pubDate>Mon, 24 Feb 2020 16:38:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626899#M77486</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2020-02-24T16:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626902#M77487</link>
      <description>I was hoping for a SAS Program that can determine the cells with titles&lt;BR /&gt;that need to be repeated in the second column for each user in that part of&lt;BR /&gt;the list&lt;BR /&gt;Then keep going through the list - as there is no pattern - it is just the&lt;BR /&gt;names of the users within each Shared Directory on the SAS Server.&lt;BR /&gt;The data is pumped out of our system in this manner - we need to get a&lt;BR /&gt;system that we can look at the access of each user.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626902#M77487</guid>
      <dc:creator>MVanderkloot</dc:creator>
      <dc:date>2020-02-24T16:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626912#M77488</link>
      <description>&lt;P&gt;First let's get your sample into an actual SAS dataset we can work with.&amp;nbsp; Let's call it HAVE and the variable USERNAME.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input username :$80.;
cards;
----sas-eg-cca-full----
wlo
knak
votte
khu
sdza
pdeb
bmc
chnel
jell
mghe
alleb
----sas-eg-hcs-chaps-full----
cmat
obri
----sas-eg-dca-phe-read----
hswe
----sas-eg-fnihbabr-ship-read----
iagm
grwn
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you just need to run a data step that creates a new retained variable, GROUP, that gets assigned the value of USERNAME when it looks like a group name instead of a username.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  if username=:'----' then group=username;
  else output;
  retain group;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;Obs    username                  group

  1     wlo        ----sas-eg-cca-full----
  2     knak       ----sas-eg-cca-full----
  3     votte      ----sas-eg-cca-full----
  4     khu        ----sas-eg-cca-full----
  5     sdza       ----sas-eg-cca-full----
  6     pdeb       ----sas-eg-cca-full----
  7     bmc        ----sas-eg-cca-full----
  8     chnel      ----sas-eg-cca-full----
  9     jell       ----sas-eg-cca-full----
 10     mghe       ----sas-eg-cca-full----
 11     alleb      ----sas-eg-cca-full----
 12     cmat       ----sas-eg-hcs-chaps-full----
 13     obri       ----sas-eg-hcs-chaps-full----
 14     hswe       ----sas-eg-dca-phe-read----
 15     iagm       ----sas-eg-fnihbabr-ship-read----
 16     grwn       ----sas-eg-fnihbabr-ship-read----&lt;/PRE&gt;
&lt;P&gt;If you really want to remove those quadruple dashes you might update the code that sets GROUP.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;group=transtrn(username,'----',trimn(' '));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Feb 2020 17:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626912#M77488</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-24T17:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626955#M77489</link>
      <description>Thank you for your help - it works perfectly...&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Feb 2020 18:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626955#M77489</guid>
      <dc:creator>MVanderkloot</dc:creator>
      <dc:date>2020-02-24T18:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Taking a Single column of data and splitting it into several columns based on the subtitles.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626963#M77490</link>
      <description>&lt;P&gt;If you are reading it directly from a file (or a piped output of another operating system command) then you can take advantage or the DLMSTR= option on the INFILE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile cards dlmstr='----';
  input username :$80.;
  if _infile_=:'----' then group=username;
  else output;
  retain group;
cards;
----sas-eg-cca-full----
wlo
knak
votte
khu
sdza
pdeb
bmc
chnel
jell
mghe
alleb
----sas-eg-hcs-chaps-full----
cmat
obri
----sas-eg-dca-phe-read----
hswe
----sas-eg-fnihbabr-ship-read----
iagm
grwn
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Feb 2020 18:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-a-Single-column-of-data-and-splitting-it-into-several/m-p/626963#M77490</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-24T18:47:23Z</dc:date>
    </item>
  </channel>
</rss>

