I need to get the file name from a Database table(DB2). The table has a job name and file name cross reference.Then pass the file name as a job parameter to the sequential file which processes it.
I would like to have a before job shell which gets the file name and passes it to the job parameter. Is it possible?
( I can do it with a hash file with job name file name and file name- he look it up and pass it to the parameter-but have to change all the jobs which are already coded. A before routine would make it easy and nobody would even notice the change in design )
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
ray.wurlod wrote:can not legally be changed thereafter
Ray, just a bit curious to know - does this mean there is a illegal way to do this?
Search the forum for the setting job params and you find the way to set params in before job routines.
Use the job parameters and set their values in before job as suggested by Ray and you will have value from database.
If this filename is just a target filename, there is one more way.
You can do the samething using after job routines. Store the result in some temp job and write an after job routine which will rename the temp file to actual file. Here you can get the value from DB or have it whatever you want.
Kirtikumar wrote:Use the job parameters and set their values in before job as suggested by Ray and you will have value from database.
I think I am not able to explain my requirements:
In a Unix directory I have a file. My job knows the direcoty path at run time and also knows the first part of the file name. I want my job to run any file that matchs the pattern.
How would I give the pattern in the Sequential Stage.
If I can do that- I do not need to assign job parameters.
Thanks for your help
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
How does your job 'know' these things? If it knows them, go ahead and use that knowledge in the Sequential File stage.
What you should be doing is parameterizing both pieces and use those parameters in the stage.
Forget about all this 'before routine sets parameter values in running job' or seeking any... 'illegal' means of doing so, that path only leads to the Dark Side.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Though I did not understand your req. this might be helpful ,When you want to process all the files which has a particular pattern why don't you use Folder stage.
Though I did not understand your req. this might be helpful ,When you want to process all the files which has a particular pattern why don't you use Folder stage.
Thanks
My doesn't know what is the file name. So I cannot use this parameter. What I know is the file pattern..
Like Unix uses metacharacters- can we use them in Datastage...so that the sequential file stage picks up any file if it matches the pattern
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.