As/400 question:
I am declaring 3 files in CL-ILE, How will CL differentiate between those 3 files? Will it be through the record format names? Does the concept of OPNID come into picture?
Can anyone throw some light on what is OPNID and how CL can differentiate more than 1 file when it is declared?
Thanks.
Software/Hardware used:
ASKED:
February 6, 2013 8:14 AM
UPDATED:
February 6, 2013 4:12 PM
Why would the CL have an issue if the file names are different or do the files all have the same record format name ? How are these files being used? Are you using the RCVF, OPNQRYF, OVRDBF or other command?Post your code and let’s see what you are trying to do.
When more than one file is declared in a CL program the OpnID is how you control which file is to be used by commands such as RcvF. The OpnID parameter of the DclF command defaults to *NONE, and this value is only allowed on one file in the program — so you have to provide, in your example, an OpnID for at least two of your three files.
In addition to being how you specify what file is to be used, OpnID also influences the generated variable names for fields defined within the file record format.
I suggest you prompt the DCLF command, press F1 for help, and then F2 for extended help. You will find a reasonably good explanation of how OpnID is used.