<?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: Adding a space in the middle of a number (using a DI Studio expression or format) in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125904#M1611</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. The variable is already a character, and it has a decent length, but I can't make SUBSTR do what I'd like. Any advice on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Nevermind, got it, thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2012 10:57:08 GMT</pubDate>
    <dc:creator>TurnTheBacon</dc:creator>
    <dc:date>2012-11-14T10:57:08Z</dc:date>
    <item>
      <title>Adding a space in the middle of a number (using a DI Studio expression or format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125902#M1609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have the number "15748645879", and want to add a space after the 6th number so that it becomes "157486 45879", how do I accomplish this in a DI Studio transformation expression (or format)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 09:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125902#M1609</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-11-14T09:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a space in the middle of a number (using a DI Studio expression or format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125903#M1610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please clarify.&amp;nbsp; Is your starting value a numeric variable or a string?&amp;nbsp; If a numeric, are you wanting an output string in the format you describe?&amp;nbsp; (If so you will need a PICTURE format.)&amp;nbsp; But if your starting point is already a string and you need to insert a space you could achieve this with the SUBSTR() function.&amp;nbsp; Note that in the latter case the string length will have increased so your variable needs to be long enough to hold the extra space character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard in Oz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 10:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125903#M1610</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2012-11-14T10:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a space in the middle of a number (using a DI Studio expression or format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125904#M1611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. The variable is already a character, and it has a decent length, but I can't make SUBSTR do what I'd like. Any advice on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Nevermind, got it, thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 10:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125904#M1611</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-11-14T10:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a space in the middle of a number (using a DI Studio expression or format)</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125905#M1612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = substr(value, 1, 6) || ' ' || substr(value, 7, 5) ;&lt;/P&gt;&lt;P&gt;should work if you want to put the result back into the same variable and you have the room.&amp;nbsp; If not, show me the log!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard in Oz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length value $12 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = "15748645879" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = substr(value, 1, 6) || ' ' || substr(value, 7, 5) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Put value= ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value=157486 45879&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Richard in Oz - added code to demonstrate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 11:06:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-a-space-in-the-middle-of-a-number-using-a-DI-Studio/m-p/125905#M1612</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2012-11-14T11:06:04Z</dc:date>
    </item>
  </channel>
</rss>

