I have created a job paramiter with the date datatype and I want to put in some default code that will dynamicaly produce a date. Ie OCONV(DATE(),'D-YMD')
From what I have read in the DS help files the Date() function should only return the date not time. When I put this code into the paramiter to run the job i get the error that i must include a valid date (not including time)
is there a function that will dynamicaly give me the date that I can use with the date datatype in a job paramiter?
Jim
Job Paramiter using Date datatype
Moderators: chulett, rschirm, roy
Job Paramiter using Date datatype
Sure I need help....But who dosent?
Re: Job Paramiter using Date datatype
The Date() function returns an integer. So it doesn't have any timestamp in it.
Can you post the error ur having ? Did u try X = Oconv(Date(), "D") just the regular one.
IHTW
Can you post the error ur having ? Did u try X = Oconv(Date(), "D") just the regular one.
IHTW
Re: Job Paramiter using Date datatype
That technically should work fine as the Date type expects data in 'YYYY-MM-DD' format. Can you explain what you mean by "I put this code into the paramiter to run the job"? Are you writing Batch Job Control to do this or is this via a Sequence Job or ??JDionne wrote:I have created a job paramiter with the date datatype and I want to put in some default code that will dynamicaly produce a date. Ie OCONV(DATE(),'D-YMD')
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Job Paramiter using Date datatype
when i go into director and click on the little blue arrow i have a paramiters tab along with my limits tab and traceing tab. I have to put in a value at this point for the job paramiter. i put in OCONV(DATE(),'D-YMD') and get a pop up window that tells me i have to add a date to the field when i try to click ok.chulett wrote:That technically should work fine as the Date type expects data in 'YYYY-MM-DD' format. Can you explain what you mean by "I put this code into the paramiter to run the job"? Are you writing Batch Job Control to do this or is this via a Sequence Job or ??JDionne wrote:I have created a job paramiter with the date datatype and I want to put in some default code that will dynamicaly produce a date. Ie OCONV(DATE(),'D-YMD')
Jim
Sure I need help....But who dosent?
If you are running a job from Director and a job parameter is of datatype DATE, you MUST supply a value and it MUST in be the form of YYYY-MM-DD. This is a literal value.
During job control execution of a job you must supply a value and it also must be in the form YYYY-MM-DD.
During job control execution of a job you must supply a value and it also must be in the form YYYY-MM-DD.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kcbland wrote:If you are running a job from Director and a job parameter is of datatype DATE, you MUST supply a value and it MUST in be the form of YYYY-MM-DD. This is a literal value.
During job control execution of a job you must supply a value and it also must be in the form YYYY-MM-DD.
agreed, so Oconv(date(), "D-YMD[4,2,2]") should work, at least in my mind it should..but it does not. is there a better way to do this so that I have a constant load date, with out a time stamp?
Jim
Sure I need help....But who dosent?
You must have missed the "This is a literal value." part, Jim. You must explicity input the date in the Director, you can't plug in a "transform" there and expect it to run.
Use a Stage Variable. Put your transform in as the Initial Value (it will run and be evaluated there - once) and then use it to populate your field in the job. Either that or write a Job Control 'wrapper' for the job to determine this value for you.
Use a Stage Variable. Put your transform in as the Initial Value (it will run and be evaluated there - once) and then use it to populate your field in the job. Either that or write a Job Control 'wrapper' for the job to determine this value for you.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Date() returns the system date. Prefer the system variable @DATE, which has its value set at the beginning of the job and does not change subsequently. Similarly prefer @TIME to Time(). The initial value for a start timestamp stage variable could then be generated from these.JDionne wrote:Oconv(date(), "D-YMD[4,2,2]") should work, at least in my mind it should..but it does not. is there a better way to do this so that I have a constant load date, with out a time stamp?
Jim
You could also use the DSJobStartTimeStamp macro, or the DataStage function DSGetJobInfo(DSJ.ME, DSJ.JOBSTARTTIMESTAMP), which is the same thing.
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.