+ Reply to Thread
Results 1 to 6 of 6

Thread: Using Environment Variables in RPG

  1. #1

    Default Using Environment Variables in RPG

    Why are you using Qp0zGetSysEnv and not getEnv? Jeff

  2. #2
    Guest.Visitor Guest

    Default Using Environment Variables in RPG

    Because I want to access the system environment variables not the job environment variables.

  3. #3
    Guest.Visitor Guest

    Default Using Environment Variables in RPG

    I figured it out with the help of Bob Cozzi. I was passing a parameter incorrectly. I have pasted the correct code below.
    Code

  4. #4

    Default Using Environment Variables in RPG

    cbougher wrote: > > I figured it out with the help of Bob Cozzi. I was passing a parameter incorrectly. I have pasted the correct code below. > I don't think you should use options(*string) on the second parameter. options(*string) should be used for input-only parameters, but the second parameter is an output parameter. Just having the VALUE keyword will make it work. Coding options(*string) won't cause you any problems, as long as you pass a pointer and not a character string. A problem would only occur if you did code a character string as a parameter, by accident, but better not to even allow the possibility of passing a character string. Also, I wouldn't code options(*string) on the last parameter. It's a reserved parameter, so you should make any assumptions about how it might be used. (According to the documentation, you can only pass *NULL anyway. Having the VALUE keyword is sufficient there too.)

  5. #5
    Guest.Visitor Guest

    Default Using Environment Variables in RPG

    I'm having trouble getting an api to work. This is the prototype I'm using (see code below) Is there anything wrong with this? I allocate enough space to the Value Ptr and when I call the proc passing in the key, the pointer, the number of bytes alloocated(1024), 0 and *null I get back a numm pointer, size has 11 CCSID has -1199.... and the return code is 0. TIA
    Code

  6. #6
    Guest.Visitor Guest

    Default Using Environment Variables in RPG

    Thanks for the tips!

+ Reply to Thread

Similar Threads

  1. Indicator variables
    By buck.calabro@commsoft.net in forum SQL
    Replies: 4
    Last Post: 01-24-2005, 04:37 AM
  2. Variables and QMQRY
    By ukpi1b in forum General
    Replies: 0
    Last Post: 10-17-2004, 07:32 AM
  3. Variables in SQL statements?
    By Guest.Visitor in forum SQL
    Replies: 1
    Last Post: 01-27-2003, 06:35 AM
  4. Based variables
    By depalm@setarnet.aw in forum Programming
    Replies: 1
    Last Post: 08-25-2001, 07:13 AM
  5. Environment Variables...HELP!
    By tdaly@sddsystems.com in forum Application Software
    Replies: 18
    Last Post: 03-12-2001, 08:29 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