Sometimes you need TOBi to create a Physical File on your IBM i but you do not want it to automatically create a member at the same time.
Maybe your application adds members later under program control. Maybe you are setting up a file that will only ever have members added by ADDPFM or by some other process. Or maybe you just like keeping tight control over when members appear. Whatever the reason, the default behaviour creates the file and adds a member with the same name as the file.
Good news. The TOBi team added proper support for this. You can now tell TOBi to pass MBR(*NONE) when it builds the file.
How to do it
You control this in your Rules.mk file using a target-specific variable. The CRTPF is default by standard, but by specifying MBR = *NONE, creates the file without adding any member.
Here is the default pattern:
If you want to ignore the default member then add:
MYFILE.FILE: private MBR = *NONE
MYFILE.FILE: myfile.pf
When TOBi runs the underlying CRTPF command for that object, it now includes the MBR(*NONE) parameter.
What actually happens under the covers
Without the setting TOBi does something like:
With MBR = *NONE it becomes:
The file object is created in the library but it has zero members. Clean and exactly what you asked for.
A few practical tips
- Put the line in the Rules.mk that is in scope for that source (usually the one in the same directory or the root Rules.mk that includes everything).
- You only need this on the specific files that should have no member. Leave everything else alone so normal files still get their member created.
- If you are using BOB AI (and you should be), just say something like: *"Update the Rules.mk in this folder so MYFILE.pf is created with MBR(NONE)" Bob will make the change for you.
- Test with a clean build the first time so you can see the exact command TOBi generates.
That is all there is to it. One small line in Rules.mk and you now have full control over whether a Physical File gets a member or not.
