Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

What Is the "Environment"?

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

  • What Is the "Environment"?

    ** This thread discusses the article: What Is the "Environment"? **
    ** This thread discusses the Content article: What Is the "Environment"? **
    This is a discussion about What Is the "Environment"?.

    Click here for the article.


  • #2
    What Is the "Environment"?

    ** This thread discusses the article: What Is the "Environment"? **
    Unlike parameters which do no have a name, only a positional ID, the environment variable has a name and it lends itself to jump over programs. For example: PGMA calls PGMB. PGMB calls PGMC. PGMC calls PGMD. If I need to pass a parameter from PGMA to PGMD, I would need to to change PGMB and PGMC. With environment variables I donot need to change all the programs in between. But from within RPG which is the general used language i Cannot call a CL Program, only through QCMDEXC, and it does not allowed the Retrieve Variable fucntion.

    Comment


    • #3
      What Is the "Environment"?

      ** This thread discusses the article: What Is the "Environment"? **
      From within RPG, you don't need the CL command that Cozzi develops in this article. Remeber, the CPP for the command _is_ in RPG. Simply use the same Qp0zGetEnv API that is used in the RTVENVVAR RPG, and use the pointer returned to directly reference the string (via %str(pEnv) in the code given.) Chris

      Comment


      • #4
        What Is the "Environment"?

        ** This thread discusses the article: What Is the "Environment"? **
        Okay, I've read the article and as usual Bob has shown us something different that is available on the system. However, I know that I've only had my 10th cup of coffee, but how does this differ from data areas? Don't get me wrong, I am always looking to learn something new, but does this tool give any advantages/differences over data areas?

        Comment


        • #5
          What Is the "Environment"?

          ** This thread discusses the article: What Is the "Environment"? **
          He gave you some reasons: 1 - Let's say you're running version 1.0 of software package YADDA. And in 1.0 they define Company name as 15 characters. So you assign 15 characters of your lda for company name. The next 10 characters are for company address, and so on. Now, you go to version 2.0. And they increased the sizes of all fields. Now your data area is all hosed, or truncated. With environment variables you don't have that problem. Trust me, I've used software versions that have increased the sizes of fields that have caused great grief, like the key to the item master in an ERP package.

          Comment


          • #6
            What Is the "Environment"?

            ** This thread discusses the article: What Is the "Environment"? **
            I use data areas (not lda) and externally described data structures. I think it would be hard to beat with this environment variable stuff. Along with *LIKE DEFNs, I rarely care how long a field is or was. rd

            Comment


            • #7
              What Is the "Environment"?

              ** This thread discusses the article: What Is the "Environment"? **
              Thanks for this great explanation and tool - we are currently using dataareas to store variable data for CL programs, but as you know it is all positional, so if someone shifts something in a data area just one byte, the whole process heads south - with this tool we can still use a dataarea to store our run parms, and I can write a quick command to extract the values of the data area and load them to the enviroment variables, and then retrieve them from a cl program and not worry about the displacements within the data area. Thanks!

              Comment


              • #8
                What Is the "Environment"?

                ** This thread discusses the article: What Is the "Environment"? **
                Great article. Being new to using C API's I am wondering how to program to get the system environment variable.

                Comment


                • #9
                  What Is the "Environment"?

                  ** This thread discusses the article: What Is the "Environment"? **
                  Obviously if you call the API that I used in the RTVENVVAR command's CPP (command processing program) you too can call and extract environment variable directly from within RPG IV. I wrap that API in a subprocedure in the RPG xTools. While the xTools' source is copyrighted (www.rpgxtools.com) I've included the code for the GeEnvVar() subprocedure here.
                  Code

                  Comment


                  • #10
                    What Is the "Environment"?

                    ** This thread discusses the article: What Is the "Environment"? **
                    I'm trying to compile the RPG program for this and receiving the following error. I am not an RPG programmer so if someone could help me resolve this I would be very grateful! Thanks so much - Jim
                    Code

                    Comment


                    • #11
                      What Is the "Environment"?

                      ** This thread discusses the article: What Is the "Environment"? **
                      jfrench wrote: > I'm trying to compile the RPG program for this and receiving the > following error. I am not an RPG programmer so if someone could help > me resolve this I would be very grateful! Thanks so much - Jim Jim, I think what it's saying is that you are compiling to a different name than what you prototyped it as. Bill

                      Comment


                      • #12
                        What Is the "Environment"?

                        ** This thread discusses the article: What Is the "Environment"? **
                        You're absolutely correct. Thanks for the help.

                        Comment

                        Working...
                        X