Problem with Multi Instance Job
Moderators: chulett, rschirm, roy
Problem with Multi Instance Job
HI,
I am trying to make unique file names for Multi Instance Jobs, While going thru the old post i saw the trick illustrated by Vincent to concatenate #JOBINVOCATIONID# with the file name and the invocation ID will be cat. But when i go back and see the folder its shows me the file name with the variable name instead of the invocation ID, i am giving while running the job.
E:\OutputFiles\MergeFile#JOBINVOCATIONID#.txt
and i am getting the same name of the file instead of Invocation ID concatenated.
Am i doing something wrong?
I am trying to make unique file names for Multi Instance Jobs, While going thru the old post i saw the trick illustrated by Vincent to concatenate #JOBINVOCATIONID# with the file name and the invocation ID will be cat. But when i go back and see the folder its shows me the file name with the variable name instead of the invocation ID, i am giving while running the job.
E:\OutputFiles\MergeFile#JOBINVOCATIONID#.txt
and i am getting the same name of the file instead of Invocation ID concatenated.
Am i doing something wrong?
Regards,
Affan
"Questioning is Half Knowledge"
Affan
"Questioning is Half Knowledge"
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The invocation ID macro can not be used directly as a parameter reference in a file name. You must create a job parameter, populate it with the value of the invocation ID (or anything else you please). Job parameter references can be used in file names.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi,
Excuse me guys but I beg to differ !!!
I use DSJobInvocationId (the macro equivalent of the DSGetJobInfo()) alot and it works fine as part of file names and even DB stage where part !!!
IHTH,
Excuse me guys but I beg to differ !!!
I use DSJobInvocationId (the macro equivalent of the DSGetJobInfo()) alot and it works fine as part of file names and even DB stage where part !!!
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
my variable name is JobInvID and di am giving it a value DSJobInvocationId
but still no luck it concatenates the staring as it is.
the type of the param is string. do i need to do something else as well.
do i have to write something else as well in the default value text box.
but still no luck it concatenates the staring as it is.
the type of the param is string. do i need to do something else as well.
do i have to write something else as well in the default value text box.
Regards,
Affan
"Questioning is Half Knowledge"
Affan
"Questioning is Half Knowledge"
This isn't all that complicated, guys.
You do not need a Job Parameter and you can use the macro directly in the 'File name' field of the Sequential File stage. The only odd thing is you must wrap it in pound/hash signs as if it were a Job Parameter. So, try...
without any similarly named job parameter to get in the way and you'll be fine.
![Confused :?](./images/smilies/icon_confused.gif)
You do not need a Job Parameter and you can use the macro directly in the 'File name' field of the Sequential File stage. The only odd thing is you must wrap it in pound/hash signs as if it were a Job Parameter. So, try...
Code: Select all
E:\OutputFiles\MergeFile#DSJobInvocationId#.txt
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I don't believe that you can as this would seem to me to fall into the same class of problem as the "job parameter in a job parameter" one. The manual states that the various macros "can be used in all active stages and before / after subroutines".maffan76 wrote:Seconldy how can i use the macro in Job Paramater to assign value as in some cases it is very helpful.
What kind of usage were you thinking of? Perhaps if you explained why you were thinking you needed a macro in a job parameter, I'm sure someone here could come up with a viable alternative approach.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I am thinking of lets say calculating the dynamic value based on routine and if i would be using the variable then the only plcae i would hve to make change will be the routine. otherwise i'll have to change it every where.
e.g. i want to create the dynamic name of the file based on timestamp and a fix string. this way if i change the strategy of file naming the change will be very minimal.
e.g. i want to create the dynamic name of the file based on timestamp and a fix string. this way if i change the strategy of file naming the change will be very minimal.
Regards,
Affan
"Questioning is Half Knowledge"
Affan
"Questioning is Half Knowledge"
The typical answer there would be to use the routine (via the Routine Activity stage) in a Sequencer job. The output of the routine, the dynamic filename, could then easily be passed as a parameter to a downstream job.
Keep in mind that, if you try and let the sequencer 'automatically handle failures', that a non-zero return code from a routine is considered a failure.
Keep in mind that, if you try and let the sequencer 'automatically handle failures', that a non-zero return code from a routine is considered a failure.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers