wyatt@wildatainc.com
Bob, you made the statement: "I would use only the environment in future applications and never use the local data area again." How do you retrieve the variables from an application? The i5/OS commands are ADD, CHG, RMV, and WRK. I did not see a RTV command. I checked in "The Modern RPG IV Language, 4th edition", but you didn\'t have any methods for handling this. The WRK command does not even allow for a *PRINT option. I don\'t see how you plan to access the information programmatically. What am I missing?
Guest.Visitor
Here is a link to a sample program that uses APIs http://search400.techtarget.com/tip/0,289483,sid3_gci1187609,00.html
R.Cozzi
Check out my article on The Environment at this URL: http://www.mcpressonline.com/mc?1@232.1KNKfHX1eQT.17@.6b22867c There are two APIs that Get and Change environment variables for your job and another two that Get and Change system-wide environment variables.
 D Qp0zPutEnv PR 10I 0 ExtProc(\'Qp0zPutEnv\') D envvar * VALUE OPTIONS(*STRING) D nCCSID 10I 0 VALUE D getenv PR * ExtProc(\'getenv\') D pEnvVar * D VALUE OPTIONS(*STRING) 
The first one is used like this: qp0zPutEnv(\'CLASSPATH=/cozzi/ibmird;/java/macros\':0); The Get is used like this: varValue = %str(getenv(\'CLASSPATH\')); There\'s other ones as well.
R.Cozzi
I went ahead and pulled the rest of the API prototypes from my upcoming book "RPG TNT: 101 Dynamite Tips \'n Techniques for RPG IV".
 D Qp0zGetEnvCCSID... D PR * extProc(\'Qp0zGetEnvCCSID\') D envVarName * VALUE OPTIONS(*STRING) D CCSID 10I 0 D Qp0zPutEnvCCSID... D PR * extProc(\'Qp0zPutEnvCCSID\') D envVar * VALUE OPTIONS(*STRING) D CCSID 10I 0 Value D Qp0zInitEnv PR 10I 0 extProc(\'Qp0zInitEnv\') D Qp0zDltEnv PR 10I 0 extProc(\'Qp0zDltEnv\') D envVarName * VALUE OPTIONS(*STRING) ** CGI API for Get Environment Variable Value D QzsrGetEnvCCSID... D PR extProc(\'QzsrGetEnvCCSID\') D rtnBuff 65535A OPTIONS(*VARSIZE) D nLenRtnBuff 10I Const D nRtnValueLen 10I D varName 256A Const OPTIONS(*VARSIZE) D nLenVarName 10I 0 Const D nVarNameCCSID 10I 0 Const D nRtnBuffCCSID 10I 0 Const D apiError LikeDS(QUSEC_T) OPTIONS(*VARSIZE) ** CGI API for Get Environment Variable Value D QtmhGetEnv PR extProc(\'QtmhGetEnv\') D rtnBuff 65535A OPTIONS(*VARSIZE) D nLenRtnBuff 10I Const D nRtnValueLen 10I D varName 256A Const OPTIONS(*VARSIZE) D nLenVarName 10I 0 Const D apiError LikeDS(QUSEC_T) OPTIONS(*VARSIZE) D Qp0zPutSysEnv PR 10I 0 extProc(\'Qp0zPutSysEnv\') D envVar * VALUE OPTIONS(*STRING) D CCSID 10I 0 Const D reserved * VALUE OPTIONS(*OMIT) D Qp0zGetSysEnv PR 10I 0 extProc(\'Qp0zGetSysEnv\') D envVarName * VALUE OPTIONS(*STRING) D rtnBuffer 65535A OPTIONS(*VARSIZE) D bufLen 10I 0 Const D CCSID 10I 0 D reserved * VALUE OPTIONS(*OMIT) D Qp0zSystem PR 10I 0 extProc(\'Qp0zSystem\') D CLcmd * VALUE OPTIONS(*STRING) D Qp0zDltSysEnv PR extProc(\'Qp0zDltSysEnv\') D envVarName * VALUE OPTIONS(*STRING) D reserved * VALUE OPTIONS(*OMIT) D Qp0zGetEnv PR 10I 0 extProc(\'Qp0zGetEnv\') D envVarName * VALUE OPTIONS(*STRING) D CCSID 10I 0 D Qp0zPutEnv PR 10I 0 extProc(\'Qp0zPutEnv\') D envVar * VALUE OPTIONS(*STRING) D CCSID 10I 0 VALUE D Qp0zGetEnvNoInit... D PR * extProc(\'Qp0zGetEnvNoInit\') D envVarName * VALUE OPTIONS(*STRING) 
Please login to make comments.
User Rating: / 0
PoorBest 

   MC-STORE.COM