COBOL/400, DB2/400

560 pts.
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.



Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 4  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • CharlieBrowne
    Or have you tried creating a LF of the file and including all 3 members?
    62,385 pointsBadges:
  • mvrkrishna
    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??
    560 pointsBadges:
  • TomLiotta
    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
    125,585 pointsBadges:
  • The Most-Watched IT Questions: July 12, 2011 - ITKE Community Blog
    [...] 10. Check out TomLiotta’s approved answer on COBOL/400 and DB2/400. [...]
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: