Using environment variables with ILE-RPG

Need to recover the value of certain variables of environment on ILE-RPG programs? This example shows how to do it.

I develop applications in a mixed environment with solutions in Java and ILE-RPG. In this environment, I need to recover the value of certain variables of environment on ILE-RPG programs. This example shows how to do it.
     d getenv          pr              *   extproc('Qp0zGetEnvNoCCSID') 
     d   name                          *   value options(*string)      
                                                                       
                                                                       
     d p               s               *                               
     d path            S            256A                               
                                                                       
     c                   eval      p = getenv ('PATH')                 
     c                   if        p <> *NULL                          
     c                   eval      path = %str(p)                      
     c                   endif    
This was first published in July 2002

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close