Page 1 of 1

dynamic file name

Posted: Wed Jan 03, 2007 3:16 pm
by hobocamp
This is my first post - so go easy with me. :)

I have a server job where I need part of the output file name to be dynamic. That is, the first part of the target file name will always be the same, but the second part of the target file name would be determined by a particular character value found in my source file.

To be more specific, does anyone know of a way that I would be able to attach a value from within the source file to the output target file name?

Thanks for any help.

Thomas Smith

Posted: Wed Jan 03, 2007 3:31 pm
by I_Server_Whale
Welcome aboard! :D.

Posted: Wed Jan 03, 2007 3:49 pm
by DSguru2B
Can be done in two jobs. Find and store that special character, in a file or UerSatus. In your second job, define a parameter, while defining the parameter, the default value will be a routine which will make a call to the user status or read it from whereever you stored it. Tie the jobs together via job sequence.

Posted: Wed Jan 03, 2007 3:50 pm
by I_Server_Whale
How about defining a job parameter "File_Name_Append" and then set the value of this parameter to your character by using 'DSSetParam' function in a stage variable.

Use the 'DSGetParamInfo' in the after-job subroutine(ExecSH) to retrieve your character from the parameter and rename your created file.

This is just coming of the top of my head. It is not tested. So, I'm not sure whether it will work.

Whale.

Posted: Wed Jan 03, 2007 3:51 pm
by ray.wurlod
Can also be done in an after-job subroutine, provided you've stored the special character somewhere. But this would be a custom subroutine, not one of the out-of-the-box ones.

Posted: Wed Jan 03, 2007 3:52 pm
by DSguru2B
It wont work Whale. A job parameter cannot be set within the job. It needs to be set before the job is fired. It can definately be done before starting the job. The OP is sitting on unix, so the special character can be read and stored in a file, the contents of that file can be passed as a parameter to the job with -param option.

Posted: Wed Jan 03, 2007 5:06 pm
by ray.wurlod
Safer to assert that a job parameter can not legally be changed in a running job. Some folks out there are doing it illegally, and will need to re-think their strategy before upgrading to version 8.0, when their "hack" may cease to work.