<?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 Rounding and Substringing variables within PROC SQL in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418649#M4133</link>
    <description>&lt;P&gt;I currently have this PROC SQL code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TITLE "Subjects with High Blood Pressure (&amp;gt; 140 mmHg) (Ordered by Descending SBP)";&lt;BR /&gt;PROC SQL NUMBER;&lt;BR /&gt;SELECT StateCd LABEL = "State",&lt;BR /&gt;SSN LABEL = "Soc Sec #",&lt;BR /&gt;SBP LABEL = "Systolic BP",&lt;BR /&gt;BMI,&lt;BR /&gt;ICD10 LABEL = "ICD 10 Code"&lt;BR /&gt;FROM HypAnl.HypPrimAnl&lt;BR /&gt;WHERE SBP &amp;gt; 140&lt;BR /&gt;ORDER BY SBP DESC;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have BMI variables that currently have one decimal that I want to be rounded to the nearest whole number. I also want my ICD.10 variable to go from the format B33.19 to just B33, so basically just a substring of this variable. I have been told to do this using formats even though my first thought was to use functions. Any thoughts on the best way to do this?&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2017 01:00:40 GMT</pubDate>
    <dc:creator>HSM9</dc:creator>
    <dc:date>2017-12-06T01:00:40Z</dc:date>
    <item>
      <title>Rounding and Substringing variables within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418649#M4133</link>
      <description>&lt;P&gt;I currently have this PROC SQL code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TITLE "Subjects with High Blood Pressure (&amp;gt; 140 mmHg) (Ordered by Descending SBP)";&lt;BR /&gt;PROC SQL NUMBER;&lt;BR /&gt;SELECT StateCd LABEL = "State",&lt;BR /&gt;SSN LABEL = "Soc Sec #",&lt;BR /&gt;SBP LABEL = "Systolic BP",&lt;BR /&gt;BMI,&lt;BR /&gt;ICD10 LABEL = "ICD 10 Code"&lt;BR /&gt;FROM HypAnl.HypPrimAnl&lt;BR /&gt;WHERE SBP &amp;gt; 140&lt;BR /&gt;ORDER BY SBP DESC;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have BMI variables that currently have one decimal that I want to be rounded to the nearest whole number. I also want my ICD.10 variable to go from the format B33.19 to just B33, so basically just a substring of this variable. I have been told to do this using formats even though my first thought was to use functions. Any thoughts on the best way to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418649#M4133</guid>
      <dc:creator>HSM9</dc:creator>
      <dc:date>2017-12-06T01:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding and Substringing variables within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418653#M4134</link>
      <description>&lt;P&gt;It depends what you want - functions will change the actual value in the field whereas formats only change the way that value is displayed.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418653#M4134</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-12-06T01:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding and Substringing variables within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418654#M4135</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TITLE "Subjects with High Blood Pressure (&amp;gt; 140 mmHg) (Ordered by Descending SBP)";
PROC SQL NUMBER;
SELECT StateCd LABEL = "State",
SSN LABEL = "Soc Sec #",
SBP LABEL = "Systolic BP",
round(BMI, 1.0) as BMI,
scan(ICD10,1,'.') as ICD10 LABEL = "ICD 10 Code"
FROM HypAnl.HypPrimAnl
WHERE SBP &amp;gt; 140
ORDER BY SBP DESC;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418654#M4135</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-12-06T01:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding and Substringing variables within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418656#M4136</link>
      <description>&lt;P&gt;That worked, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418656#M4136</guid>
      <dc:creator>HSM9</dc:creator>
      <dc:date>2017-12-06T01:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding and Substringing variables within PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418657#M4137</link>
      <description>&lt;P&gt;Format for numbers, functions for strings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TITLE "Subjects with High Blood Pressure (&amp;gt; 140 mmHg) (Ordered by Descending SBP)";
PROC SQL NUMBER;
SELECT  
    StateCd LABEL = "State",
    SSN LABEL = "Soc Sec #",
    SBP LABEL = "Systolic BP",
    BMI format=6.0,
    scan(ICD10, 1, ".") LABEL = "ICD 10 Code"
FROM HypAnl.HypPrimAnl
WHERE SBP &amp;gt; 140
ORDER BY SBP DESC;
QUIT;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Rounding-and-Substringing-variables-within-PROC-SQL/m-p/418657#M4137</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-06T01:26:29Z</dc:date>
    </item>
  </channel>
</rss>

