I was using the standard STRSQL command and exited after use. When I exited I chose option 2=Exit without saving session, instead of option 1=Save and exit session. Now I have lost all my cumulative SQL history. Do you know where this data was kept? I may be able to restore it from my last backup. I have been unable to locate where the SQL statement history is kept.
Interactive SQL statement history is kept in an object named ISQLST-usrprf-devicename in the library QRECOVERY.

You can display the statement history with this command:
DMPSYSOBJ ISQLSTuuuuuddddd QRECOVERY TYPE(19) SUBTYPE(EE)

Unfortunately, Qrecovery does not get saved with the standard save commands. Unless you have explicitly saved objects from Qrecovery, I don't think you'll have anything to restore. If you had lost your SQL statement history due to changing your device name you might be able to retrieve it with the above command.

A more permanent way to save your statement history when exiting SQL is to use option 4=Save session in source file.

This was first published in April 2008