5 pts.
 File open RPG
Is there a way in an rpg program to open a file using a character field for the filename? for example: if my file name is TESTFILE I can use the line: (in rpg free)   OPEN TESTFILE; but is there a way to have character field in place of the filename:   D filename           S             10 /free     filename = 'TESTFILE';     open filename;   

Software/Hardware used:
v5r3
ASKED: September 12, 2009  8:19 AM
UPDATED: September 14, 2009  1:26 PM

Answer Wiki:
Your F spec would need two keywords F filename E DISK USROPN EXTFILE(myfile) D myfile S 10 /free myfile = 'TESTFILE'; open filename; When you compile the program either 1. a file by the name of FileName should exist in your library list with the correct structure for your program to map the field from or 2. do an OvrDbf Filename Testfile shave(*yes) to point the use of filename to an existing example of the file structure, then compile, then dltovr filename Phil
Last Wiki Answer Submitted:  September 12, 2009  11:54 am  by  philpl1jb   44,190 pts.
All Answer Wiki Contributors:  philpl1jb   44,190 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _