Automating File name in DTS

Automating File name in DTS

 

  

I am trying to have DTS kick out a text file with an automated name of the
following.

Character(s)
1 = P or T (for production or test)
2-4 = Day of the Week (MON,TUE,etc.)
5-6= ST
7-8= AR

I have worked with the script below and it seems to pull the whole Tuesday
in Day of the week. How do I make it just the first 3 characters of
vbUseSystemDayOfWeek. And will this Script do what I want it to do in naming
text file automatically?

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()
Main = DTSTaskExecResult_Success
Dim oPKG
Dim cn
Set oPKG=DTS_Preprint_Burt_CHKSUM.Parent
Set cn=oPKG.Connections("Text File(Source)")
cn.DataSource="C:\"& "P" &vbUseSystemDayOfWeek&"ST"&"AR" &".txt"
End Function

Shawn Smith
Database Administrator
Fort Worth Star-Telegram
817-390-7094
817-291-5240 cell
817-667-2757 pager
[Email Address Removed]MS Sql Server LazyDBA home page