+ Reply to Thread
Results 1 to 6 of 6

Thread: C functions with RPG

  1. #1
    Guest.Visitor Guest

    Default C functions with RPG

    I got a very good redbook named "Who Knew You Could Do That with RPG IV". It has examples of using C functions with the use of QC2LE during the compile. When I compile it with bnddir('QC2LE') and dftactgrp(*no) I get an error message "Definition not found for symbol STRTOK". I thought that this support was shipped with the operating system. There are some components of the operationg system that do not appear to be installed. I tried to install the "Common programming API's Toolkit" portion of 5769SS1, but it couldn't find it on the CD's. I have V4R3M0. Any help would be greatly appreciated. Dave

  2. #2

    Default C functions with RPG

    I usually use QUSAPIBD binding directory as well. Just add an H spec: H BNDDIR('QC2LE' : 'QUSAPIBD') and you're covered.

  3. #3
    Guest.Visitor Guest

    Default C functions with RPG

    The binder is case sensitive, and from your error message it appears that the API name strtok is being uppercased. You should use extproc('strtok') on your prototype to avoid this.

  4. #4
    Guest.Visitor Guest

    Default C functions with RPG

    Thanks. It was the case issue. I don't know the C language from a hole in the ground. Where can I get a list of these functions and what they do? The strtok was very convenient. Thanks Dave

  5. #5
    Guest.Visitor Guest

    Default C functions with RPG

    A reasonable starting place would be the ILE C for AS/400 Run-Time Library Reference in order to see what library functions are available. You will probably also want to look into getting an intro to C manual so that you can better understand the various examples in the Refernce manual.

  6. #6
    Guest.Visitor Guest

    Default C functions with RPG

    This was a posting on this topic from the RPGIV Onelist which Cozzi runs from his RPGIV.com site... You need to bind to the QC2LE binding directory CRTPGM PGM(...) MODULE(xxx xxx xxx) BINDIR(QC2LE) to use the functions. The book you mentioned has many examples of using several C functions. Although the book is interesting, I find the samples a little redundant (not that my book is any better when it comes to examples). Jon Paris actually initiated the ability to use C functions in RPG. I wrote an article on it, and have posted it on my websites. Look for it at www.rpgiv.com and click on the News and Articles link. Or go to one of the articles on the subject directly, at: http://www.rpgiv.com/rpgnews/Feb99a/highmath.html

+ Reply to Thread

Similar Threads

  1. C functions in cobol
    By David Abramowitz in forum COBOL
    Replies: 7
    Last Post: 10-03-2007, 06:38 AM
  2. 10 New Functions We'd Like to See in RPG IV
    By avrahamn@coop.co.il in forum RPG
    Replies: 51
    Last Post: 08-03-2005, 07:21 AM
  3. SQL Functions
    By K.Forsythe in forum SQL
    Replies: 5
    Last Post: 03-02-2005, 06:06 AM
  4. Built in Functions in SQL
    By David Abramowitz in forum Programming
    Replies: 3
    Last Post: 08-29-2001, 12:12 PM
  5. Built in functions in RPG IV
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 02-02-2001, 01:44 PM

Posting Permissions

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