Generate the .csv file with date or timestamp
Moderators: chulett, rschirm, roy
Generate the .csv file with date or timestamp
I am extracting data from EDI format file and capturing some records
and generating a .CSV file. The business wants to generate the file each and everytime with date or timestamp ans send as an attachment with that date.
Is this possible to send as an attachment with the date?
and generating a .CSV file. The business wants to generate the file each and everytime with date or timestamp ans send as an attachment with that date.
Is this possible to send as an attachment with the date?
Do you want the timestamp to be part of the filename or part of the file contents?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Pass current date ('-' stripped off) as parameter and use that parameter in file name.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
yes, I am calling the parallel Job in sequence but I am not using Job activity stage but execute command stage .Zhang Bo wrote:use a job sequence with a job activity to invoke the parallel job,in the job activity,pass the value Convert('-','', DSJobStartDate) (if your data format is yyyy-mm-dd)to the job parameter,then use the job parameter as part of the file name,anyone has a better idea?
So how I need to pass form the execute commnad stage
I would use a User Variables Activity stage to create a variable with the full command line for the dsjob command, including using the aforementioned function to generate the date as a parameter to that job. Then use the variable in the subsequent command activity stage.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 5
- Joined: Fri Feb 24, 2006 1:05 am
- Location: Melbourne
Re: Generate the .csv file with date or timestamp
you can use unix command to rename the file ( u can use this `date +"%Y%m%d%H%M%S"`), use the command in "after job subroutine " in the job properties.
Regrads
Kausik Mitra
Kausik Mitra
Re: Generate the .csv file with date or timestamp
Can I send file as an attachment with the date from the email notification activity stagekausikMitra wrote:you can use unix command to rename the file ( u can use this `date +"%Y%m%d%H%M%S"`), use the command in "after job subroutine " in the job properties.
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Before calling the job in the sequence add a User Variable activity stage and create a variable for your file name.
And pass this in the next Execute Command state where you call Dsjob command
Dsjob -run NORMAL -param Filename=UVA.FileName ...
Now to send this file as an attachment in your email, specify this in After Successful completion of job option for DsSendMail in jobparameter window of your job and pass the Path+FileName parameter for attachment option.
Code: Select all
For variable FileName
Change(DSJobStartDate,'-',''):'_Test1.csv
Dsjob -run NORMAL -param Filename=UVA.FileName ...
Now to send this file as an attachment in your email, specify this in After Successful completion of job option for DsSendMail in jobparameter window of your job and pass the Path+FileName parameter for attachment option.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Try this in the sequence:
1.In the user variable activity you must have given the job parameters definitions right?
add one more varialbe such as inftctgtfiledate(interface target file date) and the give the value as "DSJobStartDate[1,4] : DSJobStartDate[6,2] : DSJobStartDate[9,2]"
eg:if you have the date as 2007-07-26, the above macro takes the first four characters(2007), the tow characters starting frm 6th position(07), the two characters starting from 9th postion(26) is obtained and appended to your target file.
2. in runjobtfn under parameterlistparm pass the value
"inftctgtfiledate=": JobParametersDefinition.inftctgtfiledate
Hope this should work!!
1.In the user variable activity you must have given the job parameters definitions right?
add one more varialbe such as inftctgtfiledate(interface target file date) and the give the value as "DSJobStartDate[1,4] : DSJobStartDate[6,2] : DSJobStartDate[9,2]"
eg:if you have the date as 2007-07-26, the above macro takes the first four characters(2007), the tow characters starting frm 6th position(07), the two characters starting from 9th postion(26) is obtained and appended to your target file.
2. in runjobtfn under parameterlistparm pass the value
"inftctgtfiledate=": JobParametersDefinition.inftctgtfiledate
Hope this should work!!
What's runjobtfn? Seeing the "parameterlistparm" - I think this is a custom routine being used at your site?2. in runjobtfn under parameterlistparm pass the value
"inftctgtfiledate=": JobParametersDefinition.inftctgtfiledate
JoshGeorge's post is clear enough i believe - to get things working.
------------------
Aneesh
Aneesh
[quote="prashkvrk"]Try this in the sequence:
1.In the user variable activity you must have given the job parameters definitions right?
add one more varialbe such as inftctgtfiledate(interface target file date) and the give the value as "DSJobStartDate[1,4] : DSJobStartDate[6,2] : DSJobStartDate[9,2]"
eg:if you have the date as 2007-07-26, the above macro takes the first four characters(2007), the tow characters starting frm 6th position(07), the two characters starting from 9th postion(26) is obtained and appended to your target file.
yes, I tried in the same and one thing is I was getting the whole path in the content of the .csv file and
If I want to get any column from the Inputfile and append in the file name then also I can still use this uv stage right
1.In the user variable activity you must have given the job parameters definitions right?
add one more varialbe such as inftctgtfiledate(interface target file date) and the give the value as "DSJobStartDate[1,4] : DSJobStartDate[6,2] : DSJobStartDate[9,2]"
eg:if you have the date as 2007-07-26, the above macro takes the first four characters(2007), the tow characters starting frm 6th position(07), the two characters starting from 9th postion(26) is obtained and appended to your target file.
yes, I tried in the same and one thing is I was getting the whole path in the content of the .csv file and
If I want to get any column from the Inputfile and append in the file name then also I can still use this uv stage right