# Error: Unexpected STATEMENT FUNCTION statement at (1)

**URL:** <https://fortran-lang.discourse.group/t/error-unexpected-statement-function-statement-at-1/3435>\
**Category:** Uncategorized\
**Created:** [May 11, 2022, 6:09pm UTC](https://fortran-lang.discourse.group/t/error-unexpected-statement-function-statement-at-1/3435 "2022-05-11T18:09:43Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [May 11, 2022, 6:27pm UTC](https://fortran-lang.discourse.group/t/error-unexpected-statement-function-statement-at-1/3435/6 "2022-05-11T18:27:14Z")

</div>

Move the statement function `data(i,j) = ...` above the `write(*,*)` statement. I’m assuming the write is a remnant of a poor man’s debugging workflow. For more background, check the Oracle documentation on [statement functions](https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vnb9/index.html). Since these are really function-like definitions, they belong in the specification section, before any executable statements like write.

Btw, statement functions have been marked as obsolescent for a while. See [Questions about statement functions - #6 by msz59](https://fortran-lang.discourse.group/t/questions-about-statement-functions/3341/6)

---

_[View the full topic](https://fortran-lang.discourse.group/t/error-unexpected-statement-function-statement-at-1/3435)._
