In the following example, the file description for f1 is marked static, and so is accessible; the file description for f2 is not.
class-id a. file-control. select f1 assign "MyFile". select f2 assign "MyFile". file section. fd f1 static. 01 r1 pic x. fd f2. 01 r1 pic x. method-id main static. open output f1 *> This is OK open output f2 *> This produces the error end method. end class.