# Raster Calculator Parsing Error

I am using three cons with raster calculator to give four different results depending on the values within two rasters, aclip20151111 and sclip20151111. There are four results I want; RESULTA, RESULTB, RESULTC AND RESULTZ, RESULTZ being the result for when none of the three conditions are met. My code is below:

``````CON(((0 <= "aclip20151111" <= 45 | “aclip20151111” > 315)&(“sclip20151111” <
3)),RESULTA,CON(((45 < "aclip20151111" <= 135 | 225 < “aclip20151111” >= 315)
&(“sclip20151111” < 10)),RESULTB,CON(((135 <= "aclip20151111" <= 225)&(“sclip20151111” < 15)
),RESULTC,RESULTZ)))
``````

I am getting the error "ERROR 000989 Python syntax error: Parsing error SyntaxError: invalid syntax (line 1)".

What is the error in my input to raster calculator? I am using raster calculator as a tool in Arcmap.

You have to use conjugated conditions using 'and' or 'or', I do not think you can just write a straight forward statements like `a<raster<b`

Try:

`Con(((("aclip20151111" >= 0)& ("aclip20151111" <= 45))|((“aclip20151111” > 315)&(“sclip20151111” <3))), RESULTA, Con(((("aclip20151111">45) &("aclip20151111" <= 135)) | (((“aclip20151111” >225) & (“aclip20151111” >= 315)&(“sclip20151111” < 10)))),RESULTB,Con(((("aclip20151111" >=135) & ("aclip20151111" <= 225)) &(“sclip20151111” < 15)), RESULTC, RESULTZ)))`

But make sure you check all the conditions, I might have gotten what you wanted to do wrong.

• Many thanks reply, still getting the syntax error though sadly. Nov 11, 2015 at 17:46
• yes there was one bracket missing, `Con(((("aclip20151111" >= 0)& ("aclip20151111" <= 45))|((“aclip20151111” > 315)&(“sclip20151111” <3))), RESULTA, Con(((("aclip20151111">45) &("aclip20151111" <= 135)) | (((“aclip20151111” >225) & (“aclip20151111” >= 315)&(“sclip20151111” < 10)))),RESULTB,Con(((("aclip20151111" >=135) & ("aclip20151111" <= 225)) &(“sclip20151111” < 15)), RESULTC, RESULTZ)))` try it now, use a notepad editor that higlights properly closed brackets easily, I use notepad++ it is great for catching errors Nov 11, 2015 at 17:52
• I've updated the answer Nov 11, 2015 at 17:53
• Unfortunately still getting the same error. I've checked in notepad++ and your answer does have the correct number of brackets so its something else. Nov 12, 2015 at 8:41
• Looks like the issue may that I was pasting from word which puts in "smart quotes", I've replaced these with Ascii quotes. Nov 12, 2015 at 17:19