public void execCursorAttribute(HplsqlParser.Expr_cursor_attributeContext ctx) {
    String name = ctx.ident().getText();
    Var val = new Var(Var.Type.BOOL);
    Var cursorVar = exec.findCursor(name);
    if (cursorVar != null) {
      Cursor cursor = (Cursor)cursorVar.value;
      if (cursor != null) {
        if (ctx.T_ISOPEN() != null) {
          val.setValue(cursor.isOpen());
        }
        else if (ctx.T_FOUND() != null) {
          val.setValue(cursor.isFound());
        }
        else if (ctx.T_NOTFOUND() != null) {
          val.setValue(cursor.isNotFound());
        }
      }
      exec.stackPush(val);
    }
    else {
      trace(ctx, "Cursor not found: " + name);
      exec.signal(Signal.Type.SQLEXCEPTION);
    }
  }
Cursor attribute %ISOPEN, %FOUND and %NOTFOUND
hplsql/src/main/java/org/apache/hive/hplsql/Expression.java