Menu

BDB0004 fop_read_meta file.dat: unexpected file type or format

Anonymous
2023-05-13
2023-05-16
  • Anonymous

    Anonymous - 2023-05-13

    Hi, I'm trying an indexed cobol program to read random record. I'm getting the below error

    BDB0004 fop_read_meta file.dat: unexpected file type or format and file status 47.

             select indexfil assign to "index.dat"
                   organization is indexed
                   access mode is random
                   record key is in-emp-no
                   file status is ws-status.                      
           data division.
           file section.
           fd indexfil
              label records omitted
              value of file-id is indexfil
              recording mode is F.
    

    What are the procedures need to run ksds file program?

     

    Last edit: Simon Sobisch 2023-05-13
  • Simon Sobisch

    Simon Sobisch - 2023-05-13

    As the information is missing I can only guess: Possibly you try to open a file that is not matching the IO handler?

    As your message shows: that's a GnuCOBOL version configured to handle ORGANIZATION INDEXED with its own BDB backend, so the file you try to open was likely not created with that.

    BTW: If you register/login you don't create entries in the moderation queue - if you don't want to do that please post only a single time and wait until a mod put some time in pre-reading your post and unblock it.

     
  • Ralph Linkletter

    Attached is a functional GnuCOBOL ISAM example.
    It may prove useful.
    It is executed via the command line.
    SET VETDSN=C:\IBZANIM\GNUDATA\IBZVSAM.DAT
    VETDSN is the DDNAME as referenced in the ASSIGN clause of the SELECT statement.

    VETDSN

    If you would like the program that creates the VSAM file let me know.

    You need to pay attention to how the ASSIGN clause is used at execution.
    There is a -f compiler directive that controls the resolution of the ASSIGN clause to file name.

    Ralph

     

    Last edit: Ralph Linkletter 2023-05-13
  • Anonymous

    Anonymous - 2023-05-15

    Hi, can I get the program that creates the VSAM file,also the compiler directive that controls the resolution of the ASSIGN clause to file name.
    sorry for the duplicate request.

     
    • Mickey White

      Mickey White - 2023-05-16

      are you going to use a presorted sequential file ready to load?

       

      Last edit: Mickey White 2023-05-16
    • Ralph Linkletter

      The -f option I use
      -fassign-clause=ibm

      This is the JCL used to execute the program

      //STEP3OF3 EXEC PGM=MAKEVSAM                                             
      //VSAMDSN  DD DSN=B6555.PPL.VSAMFILE,DISP=SHR                  
      

      To execute from a .BAT / .CMD
      SET VSAMDSN=B6555.PPL.VSAMFILE
      MAKEVSAM

      The attached creates a VSAM file and subsequently reads the VSAM file created in the program.

      If executed on zOS it would fail because the VSAM file would need to be created by the IDCAMS utility. It executes on Windows without the IDCAMS cluster definition.
      ISAM is no longer supported by zOS / IBM COBOL.

      You could replace the calls to ZMSGBOX with:
      DISPLAY ZMSG1

      Ralph

       
  • Anonymous

    Anonymous - 2023-05-16

    yes. I'm new to VS code and I wanted to run execute a file cobol program to read random record. I just wanted to know how to give input(key,data) in .dat file(unsorted) and the terminal keywords to use those file to run my program. You have already given the cobol program which was very helpful. I have run sequential file program but vsam file program was not much clear in your manual. Thanks

     
    • Mickey White

      Mickey White - 2023-05-16

      Below is a program that reads a sorted sequential file and writes it to a new Index file. And a program that randomly reads a file from that indexed file.

       

      Last edit: Mickey White 2023-05-16

Anonymous
Anonymous

Add attachments
Cancel