Skip to Content

Two options to get the working directory

Estimated Reading Time: < 1 Minute

There are two library routines that allow to retrieve this information.

1. C$CHDIR called using a blank data-item

     initialize curr-dir.|curr-dir pic x(256).
     call  "C$CHDIR"  using  curr-dir.
     display "Current directory: " curr-dir. 

2. C$GETENV to get the user.dir Java property

     call "C$GETENV" using "user.dir" curr-dir.
     display "Current directory: " curr-dir. 

Two options to get the working directory