We have a program that we run once a month that records YTD information. The file is named YTDRCV18 and is a valid externally described file on the system. Every year we make a new new copy of the file, renaming it YTDRCVnn where nn is the current year. At the end of this year we will create a new file named YTDRCV19, and modify/recompile the program that uses it. How can I modify the RPGLE program to determine the correct file name base on *MONTH without having to modify it and recompile it every year
Announcement
Collapse
No announcement yet.
Variable file names
Collapse
X
-
Wouldn't it be better to determine the file name based on *YEAR?
Add keywords USROPN and EXTFILE(ytdRcvFilename) to your file definition, and add a 10 A variable called ytdRcvFilename.
Then code like this, assuming that the internal name of your file is "ytdRcv".
Code:ytdRcvFilename = 'YTDRCV' + %editc(*year : 'X'); open ytdRcv;
Comment
-
Originally posted by Barbara Morris View PostWouldn't it be better to determine the file name based on *YEAR?
Add keywords USROPN and EXTFILE(ytdRcvFilename) to your file definition, and add a 10 A variable called ytdRcvFilename.
Then code like this, assuming that the internal name of your file is "ytdRcv".
Code:ytdRcvFilename = 'YTDRCV' + %editc(*year : 'X'); open ytdRcv;
Comment
Comment