I'm trying to do some simple label printing using ILE RPG with an embedded SQL statement. The program compiles without errors and when I run it, the spooled file stays in OPN status unless I use a CLOSE statement in the file after the WRITE. If I use the CLOSE statement, the program runs fine, once and the next time I get an error that says 'I/O operation was applied to closed file'. If I then insert an OPEN statement, the next time I run the program I get the error 'OPEN was issued to opened file'.
I know I'm missing something simple but can't figure out what it is.
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.