Global Variable in File Location Object

Hi …

Wanted to know if I can use a Global Variable to point to a Remote/Local path in a File Location Object?

Tried the same - but it looks like the variables are not recognized (are not converted to the run time values).

Appreciate the help.

Thanks!

Aneesh


aneeshmenon (BOB member since 2016-11-09)

It should work. I’ve used global variables to specify both the file location property and the file name property.


eganjp :us: (BOB member since 2007-09-12)

Thanks for the response Jim!

Doesn’t seem to be working for me! Not sure what’s missing.

  1. Created a new File Location Object with protocol - FTP.
  2. Host, user credentials - hard coded into the object.
  3. Remote Directory - hard coded to a valid path on the Job Server.
  4. Local Directory set to a global variable - $GV_DS_LOCAL_STG_PATH.
  5. Simple Job with a script. Inside the script -
copy_from_remote_system('<FILE_LOCATION_OBJECT_NAME>', 'global_inventory_20151012_130943.csv');

This job fails with the error -

Cannot open file $GV_DS_LOCAL_STG_PATH/global_inventory_20151012_130943.csv> in write mode. Please check its path and permissions.

If I replace $GV_DS_LOCAL_STG_PATH with a hardcoded value - job runs fine.

Regards,

Aneesh


aneeshmenon (BOB member since 2016-11-09)

I also tried using Substitution Parameters in the File Location object - but again get a similar error. Tried using a substitution parameter against both the remote path and local path - same results.

Any help is appreciated.

Thanks!

Aneesh


aneeshmenon (BOB member since 2016-11-09)

That certainly isn’t going to work! What you need to do is create a parameter variable for the Dataflow. In the call to the Dataflow you will populate the parameter like this:

$GV_DS_LOCAL_STG_PATH || ‘global_inventory_20151012_130943.csv’


eganjp :us: (BOB member since 2007-09-12)