<?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: Separating Values in a Variable into Different Variables then Concatenating in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196547#M36918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I don't. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2015 16:28:27 GMT</pubDate>
    <dc:creator>Mgarret</dc:creator>
    <dc:date>2015-07-06T16:28:27Z</dc:date>
    <item>
      <title>Separating Values in a Variable into Different Variables then Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196545#M36916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Hi All, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I'm trying to delimit a var with different counts of values separated by ','.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I start with a table that looks like this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;" width="294"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt;" width="80"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;CustomerID &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="155"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Event_List&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;123&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;10,12,100,110,121&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;100,117,121,123,124,000&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;786&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;181,&amp;nbsp; 444, 656&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;The next step I need to do is this delimit the values into different vars.&amp;nbsp; I can use the SCAN function but there are different number counts in each var so I can specify specific positions.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;" width="868"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt;" width="80"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;CustomerID &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="155"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Event_List&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="139"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Var1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="64"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Var2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="64"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Var3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="64"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Var4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="64"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Var5&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="64"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Var6&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;123&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;10,12,100,110,121&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;10&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;12&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;100&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;110&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;121&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;100,117,121,123,124,000&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;100&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;117&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;121&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;123&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;124&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;000&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;786&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;181,&amp;nbsp; 444, 656&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;181&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;444&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;656&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Then I need to transpose them and apply a format (using just ID 456):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;" width="294"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt;" width="80"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;CustomerID &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="155"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Event_List&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;100&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;117&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;121&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;123&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;124&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;" width="294"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt;" width="80"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;CustomerID &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="155"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Event_List&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Click &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Click2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Buy &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Order &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Click Out &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Exit &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Then I need to Concatenate them back together with the format applied. &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: none;" width="294"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt;" width="80"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;CustomerID &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-left: none;" width="155"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Event_Path &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="border: dashed #bbbbbb 1.0pt; border-top: none;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;456&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-top: none; border-left: none; border-bottom: dashed #BBBBBB 1.0pt; border-right: dashed #BBBBBB 1.0pt;"&gt;&lt;P style="margin-bottom: 1.5pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Click, Click2, Buy , Order,&amp;nbsp; Click Out , Exit &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Any help will be greatly appreciated!&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 16:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196545#M36916</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2015-07-06T16:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Values in a Variable into Different Variables then Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196546#M36917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know the maximum amount of words/events ahead of time? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you need all the steps either..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 16:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196546#M36917</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-06T16:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Values in a Variable into Different Variables then Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196547#M36918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I don't. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 16:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196547#M36918</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2015-07-06T16:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Values in a Variable into Different Variables then Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196548#M36919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually it doesn't matter. If you need all the intermediate data sets you can separate this data step, but this does it in one shot. If you comment out the OUTPUT statement in the do loop you can get just the last line/data set required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards dlm=',' dsd truncover;&lt;/P&gt;&lt;P&gt;informat customerID $3. event_list $50.;&lt;/P&gt;&lt;P&gt;input customerID $ event_list $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;123, "10, 12, 100, 110, 121"&lt;/P&gt;&lt;P&gt;456, "100, 117, 121, 123, 124, 000"&lt;/P&gt;&lt;P&gt;786, "181, 444, 656"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value $ event_fmt&lt;/P&gt;&lt;P&gt;'10' = 'Click1'&lt;/P&gt;&lt;P&gt;'12' = 'Click2'&lt;/P&gt;&lt;P&gt;'110' = 'Redirect'&lt;/P&gt;&lt;P&gt;'100' = 'Rocky'&lt;/P&gt;&lt;P&gt;'117' = 'Mountain'&lt;/P&gt;&lt;P&gt;'121' = 'Ice Cream'&lt;/P&gt;&lt;P&gt;'123' = "Is"&lt;/P&gt;&lt;P&gt;'124' = "The"&lt;/P&gt;&lt;P&gt;'000' = "Best"&lt;/P&gt;&lt;P&gt;'181' = "I'm"&lt;/P&gt;&lt;P&gt;'444' = 'incredibly'&lt;/P&gt;&lt;P&gt;'656' = 'tired'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length sentence $256.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n=countc(event_list, ",")+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=1 to n;&lt;/P&gt;&lt;P&gt;word=scan(event_list, i);&lt;/P&gt;&lt;P&gt;sentence = catx(', ', sentence, put(word, $event_fmt.));&lt;/P&gt;&lt;P&gt;*output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop event_list;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 16:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196548#M36919</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-06T16:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Values in a Variable into Different Variables then Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196549#M36920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's another way, it involves more steps than Reeza as it runs the transpose and then does by processing at the end to get what you need (just remove the Where= in the proc transpose to get all CustomerID instead of just 456).&amp;nbsp; Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data start;&lt;/P&gt;&lt;P&gt;length CustomerID $10 Event_List $50;&lt;/P&gt;&lt;P&gt;input CustomerID $ Event_List $;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;123 10,12,100,110,121&lt;/P&gt;&lt;P&gt;456 100,117,121,123,124,000&lt;/P&gt;&lt;P&gt;786 181,444,656&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data merge_data;&lt;/P&gt;&lt;P&gt;length Event_list $10 Event_Char $25;&lt;/P&gt;&lt;P&gt;input Event_List $ Event_Char $;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;100 Click&lt;/P&gt;&lt;P&gt;117 Click2&lt;/P&gt;&lt;P&gt;121 Buy&lt;/P&gt;&lt;P&gt;123 Order&lt;/P&gt;&lt;P&gt;124 Click Out&lt;/P&gt;&lt;P&gt;000 Exit&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data count;&lt;/P&gt;&lt;P&gt;set start;&lt;/P&gt;&lt;P&gt;count=countc(Event_List,',')+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select max(count) into: max&lt;/P&gt;&lt;P&gt;from count;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro split;&lt;/P&gt;&lt;P&gt;data separate;&lt;/P&gt;&lt;P&gt;set start;&lt;/P&gt;&lt;P&gt;%do i=1 %to &amp;amp;max;&lt;/P&gt;&lt;P&gt;var&amp;amp;i=scan(Event_List,&amp;amp;i,","); %end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=separate&lt;/P&gt;&lt;P&gt;out=transposed (drop=_name_) prefix=Event_List;&lt;/P&gt;&lt;P&gt;where CustomerID='456';&lt;/P&gt;&lt;P&gt;var %do t=1 %to &amp;amp;max; var&amp;amp;t %end;;&lt;/P&gt;&lt;P&gt;by CustomerID;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%split&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data num_separate;&lt;/P&gt;&lt;P&gt;set transposed;&lt;/P&gt;&lt;P&gt;Event_List=input(Event_List1,6.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table separate_merge as&lt;/P&gt;&lt;P&gt;select A.CustomerID, B.Event_Char as Event_List&lt;/P&gt;&lt;P&gt;from num_separate as A inner join merge_data as B&lt;/P&gt;&lt;P&gt;on (A.Event_List1=B.Event_List);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data final (drop=Event_List);&lt;/P&gt;&lt;P&gt;retain CustomerID Event_Path;&lt;/P&gt;&lt;P&gt;set separate_merge;&lt;/P&gt;&lt;P&gt;format Event_Path $50.;&lt;/P&gt;&lt;P&gt;by CustomerID;&lt;/P&gt;&lt;P&gt;Event_Path=catx(", ",Event_Path,Event_List);&lt;/P&gt;&lt;P&gt;If Last.CustomerID then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 17:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196549#M36920</guid>
      <dc:creator>dcruik</dc:creator>
      <dc:date>2015-07-06T17:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Values in a Variable into Different Variables then Concatenating</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196550#M36921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would this work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if _n_ = 1 then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain prx1-prx6;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prx1 = 's/100/Click/';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prx1 = 's/100/Click/';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prx2 = 's/117/Click2/';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prx3 = 's/121/Buy/';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prx4 = 's/123/Order/';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prx5 = 's/124/Click Out/';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prx6 = 's/000/Exit /';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; length Event_Path $ 1024;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Event_Path = Event_List;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Event_Path = prxchange(prx1, -1, Event_Path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Event_Path = prxchange(prx2, -1, Event_Path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Event_Path = prxchange(prx3, -1, Event_Path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Event_Path = prxchange(prx4, -1, Event_Path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Event_Path = prxchange(prx5, -1, Event_Path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Event_Path = prxchange(prx6, -1, Event_Path);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; drop prx1-prx6;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 18:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-Values-in-a-Variable-into-Different-Variables-then/m-p/196550#M36921</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2015-07-06T18:11:32Z</dc:date>
    </item>
  </channel>
</rss>

