<?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: Trying to break up variable string within a cell in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267350#M7413</link>
    <description>&lt;P&gt;Freelance, thanks for your help --- Ive tried a couple things based on your recommendations. Still stuck, however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12495i7A914C863A702EC8/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screenshot (16).png" title="Screenshot (16).png" /&gt;</description>
    <pubDate>Fri, 29 Apr 2016 22:28:49 GMT</pubDate>
    <dc:creator>r4321</dc:creator>
    <dc:date>2016-04-29T22:28:49Z</dc:date>
    <item>
      <title>Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267341#M7410</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset in SAS, which was imported from excel (unfortunately a SAS download from the master database is not an option). Also, I would prefer to manipulate this data in SAS as opposed to excel. Anyhow...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have cells with multiple codes within them... usually like so 384849495959.... They are usually in groups of 4, with atleast 2 separate groups in a cell, and potentially up to 10 or more groups.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I break them up using the substring command. This seems to work well... However, SAS seems confused about the number groups beyond the first one. For example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data adt.all2;&lt;BR /&gt;set adt.all1;&lt;BR /&gt;if ap =2 then psic1 = substrn(var3,1,4);&lt;BR /&gt;if ap =2 then psic2 = substrn(var3,5,6);&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;after code &amp;nbsp; &amp;nbsp; &amp;nbsp;newcell1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newcell2&lt;/P&gt;&lt;P&gt;35554555 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;--------&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3555 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4555&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to specific the psic2 length at 6 even though it is really 4 or it unecessarily cuts off the number i want in the cell..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From this, I can reformat newcell1 as a numeric cell, while newcell2 will give me problems. Ive tried the to multiply, as well as compress, left, put and input functions to try and get newcell2 into a 'numeric variable.' However, I get errors everytime. From my reading it seems as though this has something to do with the hexadecimal representation. I get that it likely has to do with that, but that doesnt really help me in resolving the problem so that I have a numeric variable in newcell2 to work with. And re-inputting data is not really an option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyhow, thanks for your help - advice is certainly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 20:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267341#M7410</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T20:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267342#M7411</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83117"&gt;@r4321﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your codes consist of a known set of characters, e.g., only digits 0, ..., 9, you&amp;nbsp;could apply the &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n0fcshr0ir3h73n1b845c4aq58hz.htm" target="_blank"&gt;COMPRESS function&lt;/A&gt;&amp;nbsp;with&amp;nbsp;the K ("keep") modifier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var3c=compress(var3,,'kd'); /* removes all characters but digits */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're interested in the "offending" non-numeric characters that are contained in VAR3, you could post the output (5 lines) of the following PROC PRINT step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=adt.all1(obs=5);
where verify(var3, ' 0123456789');
format var3 $hex44.;
var var3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will show the hex codes of the first (up to) 22 characters of the first 5 VAR3 values in dataset ADT.ALL1 which contain characters other than blanks or digits.&amp;nbsp;Possibly, these first 5 values are representative for the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: As soon as we know the offending characters, we can specify them in the second argument of the COMPRESS function (then without the K modifier) in order to remove them. But the "keep" approach might be more elegant in your case.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 21:49:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267342#M7411</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-29T21:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267343#M7412</link>
      <description>&lt;P&gt;Please provide some additional details about your variables. I am unable to duplicate your issue with numeric or a string variable that that starts with the characters shown.&lt;/P&gt;
&lt;P&gt;Since you mention up to 10 groups I have to assume that var3 is character of at least 40 characters. Do you explicitly assign a length to the psic variables? a format?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 21:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267343#M7412</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-29T21:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267350#M7413</link>
      <description>&lt;P&gt;Freelance, thanks for your help --- Ive tried a couple things based on your recommendations. Still stuck, however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12495i7A914C863A702EC8/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screenshot (16).png" title="Screenshot (16).png" /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 22:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267350#M7413</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T22:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267351#M7414</link>
      <description>&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12496i458A0FD6B1967D0B/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screenshot (17).png" title="Screenshot (17).png" /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 22:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267351#M7414</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T22:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267352#M7415</link>
      <description>&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12497iA141BE92DE3058CC/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screenshot (18).png" title="Screenshot (18).png" /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 22:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267352#M7415</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T22:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267353#M7416</link>
      <description>Most cells have a length of 10 ...and will have more depending on how many code groups are in a cell. The data was taken into sas via excel. A database that Im pulling from only spits out in excel files, so it had to be done this way. However, it is weird that it assigns a correct character length to the first substring of '4' when I do the substring command...However, I have to specify the length at 6 if i want to get the next set of 4 numbers.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.</description>
      <pubDate>Fri, 29 Apr 2016 22:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267353#M7416</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T22:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267354#M7417</link>
      <description>&lt;P&gt;One more&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12498i30910FF173ED0AEB/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screenshot (19).png" title="Screenshot (19).png" /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 22:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267354#M7417</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T22:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267357#M7418</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83117"&gt;@r4321&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;One more&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Screenshot (19).png]&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks for posting the screenshots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This last one is easy: PSIC2 contains 4-digit codes such as 3534. In this case, the result of input(psic2,hex.) is the integer represented by the &lt;EM&gt;hexadecimal&lt;/EM&gt; number 3534, which is 13620. BYTE(13620) requests the 13621th character of the ASCII collating sequence, which contains only 256 characters, hence the "Invalid argument" notes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are your 4-digit codes &lt;EM&gt;hexadecimal&lt;/EM&gt; values? This could at least explain why not all of them can be converted to numeric values using &lt;EM&gt;standard&lt;/EM&gt; numeric informats.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 23:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267357#M7418</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-29T23:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267359#M7419</link>
      <description>It would seem that the first 4 digit code of a group (e.g., psic1) can break off into a column quite nicely and be switched into numeric format. But it would seem as though when I try to 'substring' other codes from the main variable string, they must get turned into hexadecimal values... even though all it shows me are the numbers in the individual cells...&lt;BR /&gt;&lt;BR /&gt;The question is how to rectify this?&lt;BR /&gt;Thanks for your attention / help.</description>
      <pubDate>Fri, 29 Apr 2016 23:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267359#M7419</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T23:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267361#M7420</link>
      <description>&lt;P&gt;I think, the best way to find out what's going on is to look (with a $HEX&lt;EM&gt;w&lt;/EM&gt;. format) at the original long character strings (before they are cut into pieces), especially those which cause problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is why I had suggested the PROC PRINT step applying&amp;nbsp;$HEX44. format to (a few values of) variable VAR3 in dataset ADT.ALL3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your screenshot no. 18 shows that no observations in ADT.ALL3 have VAR3&lt;U&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/U&gt; values which contain non-blank, non-numeric characters. I am surprised to see that your permanent dataset ADT.ALL3 contains a variable named VAR3C. I had used this name in my example code&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;var3c&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;compress&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;var3&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'kd'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;);&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Therefore, I suspect that you newly created VAR3C in ADT.ALL3 using the above line of code. In this case, the result "No observations ..." is only logical, because &lt;EM&gt;this&lt;/EM&gt; VAR3C, by definition, contains only digits if anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, to obtain a non-trivial result from the abovementioned PROC PRINT step, please replace "var3c" by the name of one of the variables containing those raw "&lt;SPAN&gt;multiple codes" (variable length $70 or so).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 23:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267361#M7420</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-29T23:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267363#M7421</link>
      <description>&lt;P&gt;Thanks for your comments.. heres a couple screenshots based on them&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12499i5C8801A07A323A24/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screenshot (20).png" title="Screenshot (20).png" /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 23:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267363#M7421</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T23:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267364#M7422</link>
      <description>&lt;P&gt;Heres another...which shows what the digits actually are for the first 5 observations in the dataset. Thanks.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12500iF4F9813991BF0FD7/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screenshot (21).png" title="Screenshot (21).png" /&gt;</description>
      <pubDate>Fri, 29 Apr 2016 23:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267364#M7422</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-29T23:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267365#M7423</link>
      <description>&lt;P&gt;Wonderful, thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, at least these five examples all have hex characters 0D0A -- carriage return, line feed -- as "delimiters" between the first two 4-digit codes. So, to get rid of these (and only these) unwanted characters, you can use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var3_new=compress(var3,'0D0A'x);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Or even better: &lt;EM&gt;var3&lt;/EM&gt;=... &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2016 00:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267365#M7423</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-30T00:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267366#M7424</link>
      <description>&lt;P&gt;Freelance,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not quite sure how the you figured that out! but it works!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot, I unfortunately spent most of the day trying to get this figured out...So I really appreciate your patience and help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This command works great&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data adt.all2;&lt;BR /&gt;set adt.all1;&lt;BR /&gt;var3_new =compress(var3,'0D0A'x);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But did you mean try this instead?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data adt.all2;&lt;BR /&gt;set adt.all1;&lt;BR /&gt;var3=...;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data adt.all2;&lt;BR /&gt;set adt.all1;&lt;BR /&gt;var3_new =compress(var3=...);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first one worked, but not sure what you mean by the var3=...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyhow, youre great, thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2016 00:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267366#M7424</guid>
      <dc:creator>r4321</dc:creator>
      <dc:date>2016-04-30T00:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267367#M7425</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83117"&gt;@r4321&lt;/a&gt; wrote:&lt;BR /&gt;But did you mean try this instead?
&lt;P&gt;&lt;BR /&gt;data adt.all2;&lt;BR /&gt;set adt.all1;&lt;BR /&gt;var3=...;&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;You're welcome. Sorry for being too lazy (in the middle of the night, CET) to write out the alternative code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var3=compress(var3,'0D0A'x);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;i.e., the suggesition to &lt;EM&gt;overwrite&lt;/EM&gt; VAR3 rather than create a new variable VAR3_NEW (so as to "save" the original value with the "precious" '0D0A'x characters).&amp;nbsp;The three periods "..." were meant to denote an ellipsis! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2016 00:45:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267367#M7425</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-30T00:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to break up variable string within a cell</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267653#M7428</link>
      <description>&lt;P&gt;Here is something to consider when an application "only spits out Excel": Try opening one of the files with a text editor. You might be surprised that a number of applications actually create CSV, tab delimited or&amp;nbsp;XML files but name them with an XLX or XLXS extension so that Excel will be the default application to open them.&amp;nbsp;That might give you more options to deal with the files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you search this forum you'll find folks that are doing that with SAS output creating files in HTML or XML (and other formats) but using file names that end in XLXS to open the results in Excel.&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2016 15:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Trying-to-break-up-variable-string-within-a-cell/m-p/267653#M7428</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-02T15:55:59Z</dc:date>
    </item>
  </channel>
</rss>

