Even though more info is needed to guide you, these hints may be of some help to you: 1. Use SQL in your proces. 2. look into the two system files that contains info on files and fields. Run these two Query-commands and you will get a peep into the files: RUNQRY *N QADBXREF and RUNQRY *N QADBIFLD . Both files are accessible by SQL from an RPG-program of type SQLRPGLE. Good luck
QADBXREF and QADBIFLD are physical files in QSYS, maintained for DB2. If at all possible, the files shouldn’t be used directly. The DSPDBR command over them will show all of the various LFs and views that IBM has supplied and those should be used instead, preferably using the views. DB2 itself is always expecting those files to be immediately available for update. Select an appropriate view and let DB2 handle access through the view layer. Improper access to the physical files, or simple bad luck
I’m not sure of any good way to handle the exact question of renaming a record format when the format name isn’t known. I suspect that the most useful method is not to use native I/O. Don’t use access methods that require renaming the format(s).
See the <a href=”http://itknowledgeexchange.techtarget.com/itanswers/rpg-iv-with-no-file-definitions/”>RPG iv with no file definitions…</a> question for suggestions of other methods.