The %chdir() function changes the current directory to the one specified in str.
var = %chdir(str)
A -1 returned from this function indicates an error condition.
if %chdir(’/usr/pick’) = -1 then crt ’errno=’:system(0)
If an error occurs, the error message displays from system(0) function.