<?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: Creating a character variable with specifications in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401576#M3604</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161616"&gt;@marianhabesland&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;That makes sense. I just worked on formats, so did not release it had different syntax. Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If this is for homework, you may have been expected to use a format to do the conversion, not IF/THEN statements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the format it would look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SBPHypCat = put( SBP, sbp_format.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Oct 2017 01:19:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-06T01:19:29Z</dc:date>
    <item>
      <title>Creating a character variable with specifications</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401555#M3600</link>
      <description>&lt;P&gt;I am trying to make&amp;nbsp;a character variable called SBPHypCat based on specifications of systolic blood pressure. So far I have this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data&amp;nbsp;WORK.Illus;&lt;BR /&gt;set&amp;nbsp;HypTabs.Src_Mississippi_VS;&lt;/P&gt;&lt;P&gt;if&amp;nbsp;SBP =&amp;nbsp;low - 90&amp;nbsp;then SBPHypCat = "Below Normal";&lt;BR /&gt;else&amp;nbsp;if SBP = 90 - &amp;lt; 120&amp;nbsp;then SBPHypCat = "Normal";&lt;BR /&gt;else if&amp;nbsp;SBP = 120 - &amp;lt; 140&amp;nbsp;then SBPHypCat = "High Normal";&lt;BR /&gt;else if&amp;nbsp;SBP = 140 - &amp;lt; 160&amp;nbsp;then SBPHypCat = "Stage 1 Hypertension";&lt;BR /&gt;else if SBP = 160 - &amp;lt; 180&amp;nbsp;then SBPHypCat = "Stage 2 Hypertension";&lt;BR /&gt;else SBP = 180 -&amp;nbsp;high&amp;nbsp;then SBPHypCat = "Stage 3 Hypertension";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting a bunch of errors including:&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,&lt;/DIV&gt;&lt;DIV class="sasError"&gt;a missing value, INPUT, PUT.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Is this just the wrong format to do this kind of task in, or is there another way for me to fix this?&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Oct 2017 00:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401555#M3600</guid>
      <dc:creator>marianhabesland</dc:creator>
      <dc:date>2017-10-06T00:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a character variable with specifications</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401556#M3601</link>
      <description>&lt;P&gt;You're mixing the syntax for IF/THEN statements with the syntax for creating a format.&amp;nbsp; Here's how IF/THEN statements would look:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Illus;&lt;/P&gt;
&lt;P&gt;set HypTabs.Src_Mississippi_VS;&lt;/P&gt;
&lt;P&gt;length SBPHypCat $ 22;&lt;/P&gt;
&lt;P&gt;if SBP &amp;lt;= 0 then SBPHypCat='Bad Measurement';&lt;/P&gt;
&lt;P&gt;else if SBP &amp;lt;= 90 then SBPHypCat = 'Below Normal';&lt;/P&gt;
&lt;P&gt;else if SBP &amp;lt;= 120 then SPBHypCat = 'Normal';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;else if SBP &amp;lt;= 140 then SBPHypCat = 'High Normal';&lt;/P&gt;
&lt;P&gt;else if SBP &amp;lt;= 160 then SBPHypCat = 'Stage 1 Hypertension';&lt;/P&gt;
&lt;P&gt;else if SBP &amp;lt;= 180 then SBPHypCat = 'Stage 2 Hypertension';&lt;/P&gt;
&lt;P&gt;else SBPHypCat = 'Stage 3 Hypertension';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-page"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Oct 2017 00:24:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401556#M3601</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-06T00:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a character variable with specifications</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401557#M3602</link>
      <description>&lt;P&gt;This is not the syntax for boolean expressions in IF statements.&amp;nbsp; Here are some examples.&amp;nbsp; Substitute expressions for x and y.&amp;nbsp; Notice there are no dashes or low or high.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x = y&lt;/P&gt;
&lt;P&gt;x &amp;lt;= y&lt;/P&gt;
&lt;P&gt;x &amp;lt; y&lt;/P&gt;
&lt;P&gt;x &amp;gt; y&lt;/P&gt;
&lt;P&gt;x &amp;gt;= y&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 00:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401557#M3602</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-10-06T00:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a character variable with specifications</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401560#M3603</link>
      <description>&lt;P&gt;That makes sense. I just worked on formats, so did not release it had different syntax. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 00:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401560#M3603</guid>
      <dc:creator>marianhabesland</dc:creator>
      <dc:date>2017-10-06T00:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a character variable with specifications</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401576#M3604</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161616"&gt;@marianhabesland&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;That makes sense. I just worked on formats, so did not release it had different syntax. Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If this is for homework, you may have been expected to use a format to do the conversion, not IF/THEN statements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the format it would look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SBPHypCat = put( SBP, sbp_format.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 01:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-a-character-variable-with-specifications/m-p/401576#M3604</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-06T01:19:29Z</dc:date>
    </item>
  </channel>
</rss>

