ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Cobol-400

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cobol-400

    Hi All,

    Pls can anybody tell how we can use chain keyword in cobol with small eg.

    In RPGIV :

    XXXX Chain File

    If %Found(File)
    ---------
    --------
    ENDIF

    In cobol how to do?

    pls i need it..

    Any help will be appreciated.

    Thanks
    hsp
    'Coding = Experience'
    hsp

  • #2
    Re: Cobol-400

    Assuming that you want to read the Master File keyed by CLIENT#

    Code:
         MOVE "TRUE" TO MATCH
         MOVE 12345 TO CLIENT#
         READ MASTER-FILE INTO WS-MASTER-RECORD
            [B]INVALID KEY[/B]
               DISPLAY "CLIENT NOT FOUND IN MASTER FILE"
               DISPLAY "FILE STATUS CODE IS: " MASTER-FILE-STATUS
               MOVE "FALSE" TO MATCH
         END-READ
    Philippe

    Comment


    • #3
      Re: Cobol-400

      I could have swore I posted a link to the manuals earlier this morning...maybe I didn't have enough coffee...

      The COBOL manuals can be read and/or downloaded from here:



      Terry

      Comment

      Working...
      X