Setting the current directory for execution

General discussion on the JZOS batch launcher and toolkit
Post Reply
Keefe

Setting the current directory for execution

Post by Keefe »

I am trying to use a JZOS based batch job to schedule ant based processing. The build.xml uses some relative pathnames, assuming that the current directory is set prior to invoking ant. I have tried issuing cd <directory> from the STDENV file, but that does not accomplish what I need. Is there a way to set the current working directory context prior to invoking the Java program specified in the JAVACLS parameter?
coz
Posts: 392
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

You can try adding -Duser.dir=<directory> as a JVM option in your JCL. This will set the user.dir system property at the time of JVM invocation. It may work for what you are trying to do. Then again, it may not :)
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

For ANT, the ${basedir} variable is used as the relative directory.
By default, basedir is set to the directory containing the ant script, but you can override it by setting -Dbasedir=
Post Reply