Hi All,
I am using a control job with a date parameter to capture a date and apply that date to an output name of a file I am creating. Using this coding, I can set the parameter to the current date or the date I run the job. The job is actually processing the previous days activities and I would like name the file for that day. In the file name field I use #LOAD_DTTM_Parm1# as the date parameter. I have tried as I assign the value to the variable below this:
sLOAD_DTTM_Parm1 = (sExternalDatePortion -1)
But this only gives me the value of -1 so my file name looks like this:
CRCDATE-1 instead of CRCDATA2005-05-10.
Is there another way, using the coding below the subtract a day from the current date?
Thanks in advance.
Steve
* to convert the Date portion to format as in 1997-06-03
sInternalDatePortion = Iconv(sDatePortion, "D DMY[,A3,4]")
sExternalDatePortion = Oconv(sInternalDatePortion, "D-YMD[4,2,2]")
Call DSLogInfo(" *** display - sInternalDatePortion = ":sInternalDatePortion, "JobControl")
Call DSLogInfo(" *** display - sExternalDatePortion = ":sExternalDatePortion, "JobControl")
* to concatenate the Date and Time to the environment filename
sLOAD_DTTM_Parm1 = sExternalDatePortion
Call DSLogInfo(" *** LOAD_DTTM_Parm1 - LOAD_DTTM_Parm1 = ":sLOAD_DTTM_Parm1, "JobControl")
Changing current date to previous day
Moderators: chulett, rschirm, roy
Changing current date to previous day
SWKYDERBY
Re: Changing current date to previous day
Hi Steve
If it always if you date should previous day then I sugget you to convert your input date using Iconv as it will convert you date to internal format ( Integer Value ) you substract one from this and and do a Oconv in the Date format you would like to
Hope this will help
Thank you
If it always if you date should previous day then I sugget you to convert your input date using Iconv as it will convert you date to internal format ( Integer Value ) you substract one from this and and do a Oconv in the Date format you would like to
Hope this will help
Thank you
ram1899