340 pts.
 COBOL/400, DB2/400
Hi Group,

I have a Physical file. It has 3 members, memb1, memb2 and memb3. In my cobol/400 program i need to access all the 3 members and put data into them. What is the select statement for the multimember PF? How to declare the file section for multi member PF?

TheĀ  COBOL/40o pgm should be written in such a way that based on condition1 i need to write data into memb2. BAsed on another condition i need to write data into memb3.

How to do this??

Please help in this regard.

Regards,

M



Software/Hardware used:
COBOL/400.
ASKED: July 5, 2011  5:35 AM
UPDATED: July 6, 2011  1:11 PM
  Help
 Approved Answer - Chosen by mvrkrishna (Question Asker)

From the i 7.1 Information Center, ILE COBOL Language Reference, the File Name topic says:

  • For database files, the member name cannot be specified in the program. If a member other than the first member is to be specified, the Override with Database File (OVRDBF) CL command must be used at execution time to specify the member name.

You need to run a OVRDBF command either before calling your COBOL program or in your COBOL program before opening the file.

COBOL is not controlled by IBM as much as RPG is. Putting extensions into the COBOL language probably takes more effort, so this kind of detail isn't put in unless a number of customers request it. (Just a thought of mine.)

Tom

ANSWERED:  Jul 5, 2011  10:21 PM (GMT)  by mvrkrishna

 
Other Answers:

Have you tried OVRDBF, giving a different name to each different member and using those names in your COBOL program?

Glad Tom (and IBM – LOL) agrees with me.

Last Wiki Answer Submitted:  July 6, 2011  1:11 pm  by  Rlsantucijr   445 pts.
Latest Answer Wiki Contributors:  Rlsantucijr   445 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Or have you tried creating a LF of the file and including all 3 members?

 32,905 pts.

 

I did not use OVRDBF or Logical file. Is there any other way to handle this? For example: In RPG we can specify the member name in the file declaration. Do we have the similar concept in COBOL/400??

 340 pts.