Adding current Date with the file
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
Adding current Date with the file
All,
I have create a job which will extract the data from a table and store it in a text file.
say for example,
Table Name: Emp
I want to add current date at the end of file. i.e if i run the job now, the file should be created as e_details20090701.txt
suppose if i run the job tomorrow,then the file name should be
e_details20090702.txt.
How to add the current date at the end of file ?
I have create a job which will extract the data from a table and store it in a text file.
say for example,
Table Name: Emp
I want to add current date at the end of file. i.e if i run the job now, the file should be created as e_details20090701.txt
suppose if i run the job tomorrow,then the file name should be
e_details20090702.txt.
How to add the current date at the end of file ?
Karthik
The date portion of the filename should be passed into the job as a job parameter. It is not quite clear to me whether this date is part of the data or computed elsewhere, though.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
I gave likethrobinson wrote:Jillion+1. That method too complicated and too Old School. Get Hip Daddy-O. Use a DSMacro as part of the filename in the sequential stage. <filename>#DSJobStartDate#. Use DSJobStartTimestamp if running more then once in a day. Nah, never happen.
#FileName##DSJobStartDate# but the date didn't added with the file name.
I declared one variable in the parameter
ProcessDate
with default value
1000-01-01
In the JobControl section,
I wrote one subroutine
If ProcessDate = "1000-01-01" Then ProcessDate = Oconv(Date(),"D-YMD[4,2,2]")
then i used this variable like
#FileName##ProcessDate#
But no use.
Karthik
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Try something like
where pCurrentDate is the date parameter formatted in required manner.
Code: Select all
move yourFileName yourFileName#pCurrentDate#