To add a function to the parameter value ?
Moderators: chulett, rschirm, roy
To add a function to the parameter value ?
I was trying to add a date() function to a parameter in a Job Activity in a Sequencer job. In a job activity, I have a parm called FileName and I am passing a value say File1 and want to append date to that like this...
FileName = File1 : date()
Did not work. I also try to do oconv but that did not work either.
Is it not possible to add any function to value of a parm in job activity ?
Thanks
FileName = File1 : date()
Did not work. I also try to do oconv but that did not work either.
Is it not possible to add any function to value of a parm in job activity ?
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I am sorry about that. I was executing a script from DataStage to rename a file by just adding a date to the end of the file name and the error I got is that the rename failed because both from and to names are same. Basically I am passing list of parms to the script from DS. 5th parm is the file name to be renamed and 6th parm is the new name for the file. This tells me that the date I have added is neglected for some reason.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
1. will pass a parameter to the job with the internal date like: filename16043
2. will pass a parameter to the job formatted like: filename2011/12/03
The above will work fine if you are calling a job with the Job Activity stage.
More recently you said you're executing a script. Are you using the Execute Command stage?
If so, then you can put your functions into a variable in the UserVariables Activity stage. Then in the Execute Command stage, under Parameters, click the ... button and click your variable.
2. will pass a parameter to the job formatted like: filename2011/12/03
The above will work fine if you are calling a job with the Job Activity stage.
More recently you said you're executing a script. Are you using the Execute Command stage?
If so, then you can put your functions into a variable in the UserVariables Activity stage. Then in the Execute Command stage, under Parameters, click the ... button and click your variable.
Choose a job you love, and you will never have to work a day in your life. - Confucius
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The conversion specification for Oconv() needs to be upper case - you may wish to get rid of the space delimiters that this gives by default.
Code: Select all
Name : Oconv(Date(), "D4YMD" : @VM : "MCN")
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Oconv() can accept a multi-valued list of conversions, which are applied one after another.
"D4YMD" generates "2011 12 06".
"MCN" applied to that removes the non-numeric characters, yielding "20111206".
"D4YMD" generates "2011 12 06".
"MCN" applied to that removes the non-numeric characters, yielding "20111206".
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You could have had hyphens with "D4-YMD" or underscores with "D4_YMD". Then you wouldn't have needed the "MCN". Possibly better also to enforce two-digits for month and day, for example "DYMD[4,2,2]". Without that, 2011112 is ambiguous.
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.