+ Reply to Thread
Results 1 to 7 of 7

Thread: How do I call fread() C API from an ILE RPG program??

  1. #1
    Guest.Visitor Guest

    Default How do I call fread() C API from an ILE RPG program??

    There is not a big trick to this. Just use the QC2LE binding directory when you compile your RPG pgm. What problem are you having? Jeff

  2. #2
    buck.calabro@commsoft.net Guest

    Default How do I call fread() C API from an ILE RPG program??

    > I have found the the prototype declaration, but not sure >how to declare this API and use it in the ILE RPG program. The FAQ at http://faq.midrange.com has an answer regarding how to prototype C functions in RPG. The archives will probebly help you find an IFS tutorial http://archive.midrange.com Also, the RPG Redbook has examples of dealing with the IFS. The address to the Redbook is in the FAQ. --buck

  3. #3
    ranjit.patel@gtos.co.uk Guest

    Default How do I call fread() C API from an ILE RPG program??

    I am using the declaration as show in the green screen, however, I am not sure if the declaration is correct for parameters 2 and 3. C function suggest the parameter 2 and 3 should be size_t type - not sure what RPG equivalent should be. I have tried the above declaration, but it doesn't read any data from the file. File is opened successfully.

  4. #4

    Default How do I call fread() C API from an ILE RPG program??

    size_t is defined in qsysinc/h(stdlib) as being an unsigned int. For ILE RPG this would be 10u 0 (which is what your prototype has).

  5. #5
    buck.calabro@commsoft.net Guest

    Default How do I call fread() C API from an ILE RPG program??

    > I have tried the above declaration, but it doesn't > read any data from the file. File is opened successfully. I am not familiar with that _C_IFS_fread. May I suggest again that you look at the Redbook and archives? I know there are working examples of read() and write() in both places, and probably fread/fwrite as well. --buck

  6. #6
    ranjit.patel@gtos.co.uk Guest

    Default How do I call fread() C API from an ILE RPG program??

    I have found the the prototype declaration, but not sure how to declare this API and use it in the ILE RPG program. I need to read and write data in a binary mode. Any help will be appriciated. Thanks
    Code

  7. #7

    Default How do I call fread() C API from an ILE RPG program??

    _C_IFS_fread() is what fread() maps to when *IFSIO is specified on CRTCMOD or CRTBNDC and is found in qsysinc/h(ifs). The usage is the same as for fread() and fread() examples can be found in the ILE C/C++ Run-time Library Functions manual under fread.

+ Reply to Thread

Similar Threads

  1. What program caused Exit program call?
    By Guest.Visitor in forum CL
    Replies: 0
    Last Post: 08-21-2005, 01:50 PM
  2. Call a Java program from a COBOL program?
    By Guest.Visitor in forum Programming
    Replies: 3
    Last Post: 10-23-2000, 12:25 PM
  3. can RPG program make a call to a java program?
    By Guest.Visitor in forum Application Software
    Replies: 14
    Last Post: 09-28-2000, 12:16 PM
  4. Call a Java program from a COBOL program?
    By Guest.Visitor in forum Application Software
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM
  5. Call a Java program from a Cobol Program?
    By Guest.Visitor in forum Programming
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts