tags:

views:

550

answers:

2

I'm very excited about the new "local F specs" coming in V6R1 - see:

http://www.mcpressonline.com/programming/rpg/v6r1-rpg-enhancements.html

Does anyone know a way to simulate this in V5R4 in a SRVPGM procedure?

A: 

As far as I know, you can only define them globally, but you can process just that file in a single subprocedure.

Mike Wills
+1  A: 

You can only simulate that by making modules that only processes one file globally. So the file scope is still global, but you don't share it with other files. if you really would want to have a file per procedure you'd have to make a module for each procedure. I don't recommend that. Just too many modules. But maybe your happy with the one-module-per-file style, otherwise you have to wait like me for v6r1 ;)

squarefox
I agree. You can also have the same file opened twice in your program if you name it differently in the F-spec and then use the EXTFILE keyword. You'll also need to rename the fields as well. I like to use the PREFIX keyword for that.
Tracy Probst