How could i set yesterday value as default value for a numeric parameter in datastage? - datastage

I have a numeric datatype parameter in Datastage.
*parameter name: VAR_ETL_DATE
*format:YYYYMMDD
*ex:20210612
How could i set yesterday value as default value for this parameter?
Format:YYYYMMDD (numeric)
*Example: Today:20210824
*When i run a job including VAR_ETL_PARAMETER with default value, The job should run with yesterday value(20210823)

You can't set it in a static sense, because the date of yesterday is a moving target. The best you could do would be to set it in a controlling sequence job that invokes your job.
Use any of the date offset functions to set the value. For example you could use Date() - 1 as the generating expression directly in the Job activity in your sequence.

Related

Pipeline date variable value changed

I have a variable in Azure DevOps pipeline:
TIMESTAMP: "2016-01-16T00:00:00"
I use this variable in my template to substitute variable in this template, but during pipeline execution, pipeline always change format this value to: 01/16/2016 00:00:00.
Is it possible to keep first format? I need variable in exactly this form: 2016-01-16T00:00:00.
Wrap the variable with single quotes:
TIMESTAMP: "'2016-01-16T00:00:00'"
Result:

SSRS Report Date Parameter Default for the current Year

I have an SSRS Report I've created with a "Date/Time" Parameter I have created. I am trying to create a Parameter that Defaults to the Current Year. For example in "2020" I want the Paramater to default to "01/01/2020" when we hit 2021 I want it to default to "01/01/2021" Here is what I have tried. For my default value in the parameter I have the following expression with no success.
=CDate(Year(Now())+"-"+Month(01)+"-"+Day(01))
You can do this using the following expression.
=DateSerial(YEAR(Today()), 1, 1)
You can use CDate but that relies on strings. DateSerial is easier to work with in your scenario.

How can i get only the date and time in selenium IDE

I'm using selenium IDE and i would like to capture only the date and time from a field that was updated
Example:
Updated by James in 07/05/2015 - 09:50
I need to get only this date and the time from the record updated
Is there a way to do this ?
Thanks
Well you can do it with storeEval(). You can use JavaScript to manipulate stored variables. Lets assume that you stored that whole text in variable updated
${updated} == "Updated by James in 07/05/2015 - 09:50"
Now we just need to get that variable and get part of its text:
Command: storeEval()
Target: storedVars['updated'].split(' ')[4]
Value: date
Basically we get updated and we split it into array using space as separator, and then we get 4th element of array, which contains date and store in it new variable date.
Now:
${date} == "07/05/2015"
The same you can do with time.

Sending parameters to report from Java code

I need to send a timestamp value as parameter from java to JR report. I tried the following code but I'm getting a blank report.
My JRXML File:
`
`
The report works fine with normal date parameter but fails to display with Time-stamp value.
My Java code :
`
I tried various values of timestamp Ex: (new java.sql.Timestamp(2013-02-27) but it is not working.
Use:
new SimpleDateFormat("yyyy-MM-dd").parse("2012-01-01");
Simply putting:
new Date(2012-01-01);
would give definitely wrong date, probably EPOCH start date.
Ensure it's MM not mm when parsing your date for month. See SimpleDateFormat javadoc
EDIT
See the image. The date your default values will generate is around 1970.
Hence your Between Condition will get all the values between 1970 to Today.
EDIT : 2
In my opinion You are setting wrong parameter in Table's datasource.
Instead of setting From_Date & To_Date from Fields set them as parameter from the main report itself.
Refer Image.

jasperreport server scheduling with today's date

I'm trying to set up a report using the scheduler with today's date as the input parameter. Is this possible?
I see you can set static value for the input parameter but cannot set it to now() or some variant.
report parameter name is $P{Date}
I've set the default expression to
($P{Date} == null ? new Date() : $P{Date})
And it seems to work.
Sam, in your report, could you create a parameter with a default value of today's date (see Filtering on a Date Range: http://jasperforge.org/plugins/mwiki/index.php/Jasperserver/Filtering_on_a_date_range)? Then make it mandatory so JasperReports Server will choose the default value if no other input is given.