Changing current date to previous day
Posted: Wed May 11, 2005 9:24 am
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")
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")