<?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: Help with a syntax error! in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767832#M30786</link>
    <description>&lt;P&gt;The up arrow is not a valid arithmetic operator, see the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lepg/p1n8bsqqd03xppn17pgvjpjlbhhs.htm#p1q1ipyj5ltqjan1wd1bn091zw2c" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I recommend that you bookmark the "SAS Programmer's Guide: Essentials" and use it to acquaint yourself with the basics of the SAS language whenever needed.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Sep 2021 06:09:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-09-15T06:09:52Z</dc:date>
    <item>
      <title>Help with a syntax error!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767823#M30782</link>
      <description>&lt;P&gt;I am trying to create a new variable "bmi" and print only variables childid, ht5, bweight, and bmi. When I run this I keep getting these errors. What am I missing?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data question2;
infile "/home/u59352003/btt.dat.txt";
input childid 1-4 sex 6 bweight 8-11 gestage 13-14 momage 16-17 parity 19 mdbp 21-23 msbp 25-27 momeduc 29 mmedaid 31; socio 33 dbp5 35-37 sbp5 39-41 ht5 43 -47 wt5 49-52 hdl5 54 -57 trig5 64-67 smoke5 69 medaid5 71 socio5 73;
bmi = bweight/(ht5^2);
run;
proc print data = question2 (obs=10);
var childid ht5 bweight bmi
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;76&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 22-322: Syntax error, expecting one of the following: &amp;lt;, &amp;lt;=, =, &amp;gt;, &amp;gt;=, EQ, GE, GT, LE, LT, NE, NG, NL, ^=, ~=.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2021 03:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767823#M30782</guid>
      <dc:creator>jasminek12</dc:creator>
      <dc:date>2021-09-15T03:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a syntax error!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767826#M30783</link>
      <description>&lt;P&gt;Semicolons end a statement:&lt;/P&gt;
&lt;P&gt;The code you show (slightly rearranged for readability) and a semicolon in the middle of an input statement. That ended the input so the following bits of :socio 33 dbp5 35-37 (etc) are not complete syntactically correct statements.&lt;/P&gt;
&lt;P&gt;Remove the highlighted semicolon.&lt;/P&gt;
&lt;PRE&gt;data question2;
infile "/home/u59352003/btt.dat.txt";
input childid 1-4 sex 6 bweight 8-11 gestage 13-14 momage 16-17 parity 19 mdbp 21-23 &lt;BR /&gt;     msbp 25-27 momeduc 29 mmedaid 31&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt; socio 33 dbp5 35-37 sbp5 39-41 ht5 43 -47 &lt;BR /&gt;     wt5 49-52 hdl5 54 -57 trig5 64-67 smoke5 69 medaid5 71 socio5 73;
bmi = bweight/(ht5^2);
run;
proc print data = question2 (obs=10);
var childid ht5 bweight bmi
run&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In the future any questions about errors or messages in the log you do not understand you should copy the entire data step or procedure code from the log along with the notes, messages, warnings and/or errors. Paste all the text into a text box opened on the forum with the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;The errors you referenced would have had diagnostic characters appearing under the place that SAS found the syntax problem but by only copying part of the error you didn't show those characters. Paste in a code box to prevent the message windows from reformatting the text and the diagnostic characters make more sense.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 04:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767826#M30783</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-15T04:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a syntax error!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767827#M30784</link>
      <description>&lt;P&gt;thank you for your reply! even after removing the semicolon you highlighted, I am still getting some errors. Hopefully this will be more helpful?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         data question2;
 70         infile "/home/u59352003/btt.dat.txt";
 71         input childid 1-4 sex 6 bweight 8-11 gestage 13-14 momage 16-17 parity 19 mdbp 21-23 msbp 25-27 momeduc 29 mmedaid 31
 71       ! socio 33 dbp5 35-37 sbp5 39-41 ht5 43 -47 wt5 49-52 hdl5 54 -57 trig5 64-67 smoke5 69 medaid5 71 socio5 73;
 72         bmi = bweight/(ht5^2);
                               _
                               22
                               76
 ERROR 22-322: Syntax error, expecting one of the following: &amp;lt;, &amp;lt;=, =, &amp;gt;, &amp;gt;=, EQ, GE, GT, LE, LT, NE, NG, NL, ^=, ~=.  
 
 ERROR 76-322: Syntax error, statement will be ignored.
 
 73         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.QUESTION2 may be incomplete.  When this step was stopped there were 0 observations and 21 variables.
 WARNING: Data set WORK.QUESTION2 was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              646.12k
       OS Memory           24228.00k
       Timestamp           09/15/2021 04:29:08 AM
       Step Count                        52  Switch Count  0
       Page Faults                       0
       Page Reclaims                     70
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           8
       
 
 74         proc print data = question2 (obs=10);
 75         var childid ht5 bweight bmi;
 ERROR: Variable HT5 not found.
 76         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              485.71k
       OS Memory           24228.00k
       Timestamp           09/15/2021 04:29:08 AM
       Step Count                        53  Switch Count  0
       Page Faults                       0
       Page Reclaims                     50
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           0
       
 77         
 78         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 88         &lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Sep 2021 04:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767827#M30784</guid>
      <dc:creator>jasminek12</dc:creator>
      <dc:date>2021-09-15T04:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a syntax error!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767829#M30785</link>
      <description>&lt;P&gt;Not sure what you are trying to do with this statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;bmi = bweight/(ht5^2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you are trying to square HT5 then use two asterisks (ht5**2).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 05:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767829#M30785</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-09-15T05:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a syntax error!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767832#M30786</link>
      <description>&lt;P&gt;The up arrow is not a valid arithmetic operator, see the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lepg/p1n8bsqqd03xppn17pgvjpjlbhhs.htm#p1q1ipyj5ltqjan1wd1bn091zw2c" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I recommend that you bookmark the "SAS Programmer's Guide: Essentials" and use it to acquaint yourself with the basics of the SAS language whenever needed.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 06:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-a-syntax-error/m-p/767832#M30786</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-15T06:09:52Z</dc:date>
    </item>
  </channel>
</rss>

