PDA

View Full Version : prefixed file (A.FILE, B.FILE...), overrides and ILE



Guest.Visitor
01-21-2003, 10:57 AM
Richard: You stated "The data file is declared in each module and bound to the main program module. " How are you "declaring" the data file in the bound call'ed modules? I don't have this problem(v4r4, v4r4,v5r1). The method I use is: Define the file in the main module(f spec, yada yada yada) I also, define the file as an externally defined DATA STRUCTURE with the keyword EXPORT. THEN, in each bound module I define a D spec with the keyword IMPORT. This method works IF the main module is the "driver" and the bound modle call processes each record "handed to it" from the main module. Now, I reread your statments and have something further to say, MAKE SURE that the service program is scoped to the same activation group as the MAIN ile program module. That could be the problem. I have encountered that before. hth

Absolutely_Nobody
01-21-2003, 10:57 AM
We have data files with a one-letter prefix to separate branch data. I have a main ILE RPG program that needs to process data for any number or all of the branches. So, I call a service program that was written in-house that determines the prefix for the branch to be processed and overrides the file with the appropriate prefix. The main program then calls procedures that I've written to processes data as requested and return the results back to the main program. The data file is declared in each module and bound to the main program module. The overrides that I perform in the main program are not working. I was informed that I will need to close the files before doing the overrides and then open them after the overrides are done. How is this handled in an ILE environment ? Can I keep the overrides in the main program where ? If so, will I have to declare the files in the main program as well, only to perform the close/override/open process ? Or, should I define the files only in the modules and pass the program a flag and what to override to perform the close/override/open process ? Any suggestions would be helpful. The modules in which the data files reside now are called any number of times before it will get overriden to start processing the next branch.