<?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: Error 22-322 and 180-322 - Trouble Creating New Variable! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556458#M155014</link>
    <description>&lt;P&gt;Or even&lt;/P&gt;
&lt;PRE&gt;If 100 &amp;lt;= TVBudget &amp;lt; 200 then TVSpend = 'Medium'; else&lt;/PRE&gt;
&lt;P&gt;Another approach is to create a custom format such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc format;
value tvspend
. = 'Missing'
low - &amp;lt;100 = 'Low'
100 -&amp;lt; 200 = 'Medium'
200 - High = 'High'
;&lt;/PRE&gt;
&lt;P&gt;And use the format with the numeric value:&lt;/P&gt;
&lt;PRE&gt;proc freq ;
   tables tvbudget;
   format tvbudget tvspend.;
run;&lt;/PRE&gt;
&lt;P&gt;Advantages:&lt;/P&gt;
&lt;P&gt;1) I you need to create a different grouping or change boundaries just modify the Proc Format code or create a new format as needed&lt;/P&gt;
&lt;P&gt;2) values will likely sort more consistently, as is "High" will come before "Low" or "Medium" when using character variables.&lt;/P&gt;
&lt;P&gt;3) if you have multiple variables that would use the same boundaries you simply use the same format, no need for additional variables generally.&lt;/P&gt;
&lt;P&gt;4) you don't have to address variable length issues that sometimes arise when your first character value is shorter than others and you get truncated values because you did not explicitly set a length for the target variable(s).&lt;/P&gt;
&lt;P&gt;Most of the analysis and graphic procedures will honor groups created by proc format.&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2019 15:36:02 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-05-06T15:36:02Z</dc:date>
    <item>
      <title>Error 22-322 and 180-322 - Trouble Creating New Variable!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556213#M154936</link>
      <description>&lt;P&gt;I am working with an advertising database for a school project and I've been using the online SAS Studio. I am trying to create a new categorical variable ('TVSpend') from a numerical variable ('TVBudget' which shows the amount spent on TV Advertising) with my dataset. I am having issues with it, but the first 2 variables I created worked fine. I'm sure it is something small I am overlooking, can anyone help?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The error I am getting is right after&amp;nbsp; "If TVBudget &amp;gt;= 100 and &amp;lt; 200 then TVSpend = 'Medium'; else" and the message is:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class="sasError"&gt;_ _______ _&lt;/DIV&gt;&lt;DIV class="sasError"&gt;22 180 180&lt;/DIV&gt;&lt;DIV class="sasError focus-line"&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;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Here is my code:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Libname Final '/home/pavlockb30/my_courses/SASSpring2019/MyData/FinalProject';
Data Final.Advertising;
Infile '/home/pavlockb30/my_courses/SASSpring2019/MyData/FinalProject/Advertising.csv' DSD Firstobs=2;
Input Observation TVBudget RadioBudget NewspaperBudget Sales;
If Sales &amp;gt; Sum(TVBudget, RadioBudget, NewspaperBudget) then Profit = 'Yes'; else
If Sales &amp;lt; Sum(TVBudget, RadioBudget, NewspaperBudget) then Profit = 'No'; else
If Sales = Sum(TVBudget, RadioBudget, NewspaperBudget) then Profit = 'Breakeven';

If TVBudget &amp;gt; RadioBudget and NewspaperBudget then LargestExpenditure = 'TV'; else
If RadioBudget &amp;gt; TVBudget and NewspaperBudget then LargestExpenditure = 'Radio'; else
If NewspaperBudget &amp;gt; TVBudget and RadioBudget then LargestExpenditure = 'Newspaper';

If TVBudget = . then TVSpend = 'Missing'; else
If TVBudget &amp;lt; 100 then TVSpend = 'Low'; else
If TVBudget &amp;gt;= 100 and &amp;lt; 200 then TVSpend = 'Medium'; else
If TVBudget &amp;lt;= 200 then TVSpend = 'High';
   
Run;


Proc Print Data = Final.Advertising Noobs;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 May 2019 19:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556213#M154936</guid>
      <dc:creator>pavlockb3</dc:creator>
      <dc:date>2019-05-04T19:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 and 180-322 - Trouble Creating New Variable!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556214#M154937</link>
      <description>&lt;P&gt;try changing this&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt; TVBudget &lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="token number" style="box-sizing: inherit; color: #008080; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;100&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt; and &lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="token number" style="box-sizing: inherit; color: #008080; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;200&lt;/SPAN&gt; &lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt; TVSpend &lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string" style="box-sizing: inherit; color: maroon; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;'Medium'&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt;to this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt;&lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;If&lt;/SPAN&gt; TVBudget &lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="token number" style="box-sizing: inherit; color: #008080; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;100&lt;/SPAN&gt; and TVBudget &amp;lt; &lt;SPAN class="token number" style="box-sizing: inherit; color: #008080; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;200&lt;/SPAN&gt; &lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;then&lt;/SPAN&gt; TVSpend &lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string" style="box-sizing: inherit; color: maroon; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;'Medium'&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;else&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt;&lt;SPAN class="token keyword" style="background-attachment: scroll; background-clip: border-box; background-color: #ffffff; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;If TVBudget &lt;FONT color="#006000"&gt;&amp;gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;=&lt;/SPAN&gt;&lt;/FONT&gt; &lt;SPAN class="token number" style="box-sizing: inherit; color: #008080; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;200&lt;/SPAN&gt; then TVSpend &lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string" style="box-sizing: inherit; color: maroon; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;'High'&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2019 19:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556214#M154937</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-05-04T19:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 and 180-322 - Trouble Creating New Variable!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556217#M154940</link>
      <description>&lt;P&gt;That was it! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2019 20:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556217#M154940</guid>
      <dc:creator>pavlockb3</dc:creator>
      <dc:date>2019-05-04T20:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 and 180-322 - Trouble Creating New Variable!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556458#M155014</link>
      <description>&lt;P&gt;Or even&lt;/P&gt;
&lt;PRE&gt;If 100 &amp;lt;= TVBudget &amp;lt; 200 then TVSpend = 'Medium'; else&lt;/PRE&gt;
&lt;P&gt;Another approach is to create a custom format such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc format;
value tvspend
. = 'Missing'
low - &amp;lt;100 = 'Low'
100 -&amp;lt; 200 = 'Medium'
200 - High = 'High'
;&lt;/PRE&gt;
&lt;P&gt;And use the format with the numeric value:&lt;/P&gt;
&lt;PRE&gt;proc freq ;
   tables tvbudget;
   format tvbudget tvspend.;
run;&lt;/PRE&gt;
&lt;P&gt;Advantages:&lt;/P&gt;
&lt;P&gt;1) I you need to create a different grouping or change boundaries just modify the Proc Format code or create a new format as needed&lt;/P&gt;
&lt;P&gt;2) values will likely sort more consistently, as is "High" will come before "Low" or "Medium" when using character variables.&lt;/P&gt;
&lt;P&gt;3) if you have multiple variables that would use the same boundaries you simply use the same format, no need for additional variables generally.&lt;/P&gt;
&lt;P&gt;4) you don't have to address variable length issues that sometimes arise when your first character value is shorter than others and you get truncated values because you did not explicitly set a length for the target variable(s).&lt;/P&gt;
&lt;P&gt;Most of the analysis and graphic procedures will honor groups created by proc format.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 15:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-and-180-322-Trouble-Creating-New-Variable/m-p/556458#M155014</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-06T15:36:02Z</dc:date>
    </item>
  </channel>
</rss>

