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.
Many thanks,
Derek
I know I'm missing something simple but can't figure out what it is.
Many thanks,
Derek