SSIS 2008 - Sending file with dynamic name using FTP task
Hi - Thanks for taking a look - (I'm very new to SSIS.)
I'm trying to create an SSIS 2008 package that does the following:
1) Execute a stored procedure on SQL.
2) Download the results as a CSV file to a 'local' location. The file name is set using a variable ("User::LocalFilePath") dynamically based on the current time:
@[User::LocalFilePath] + "GreatReportName_" + "_" +(DT_STR,4,1252) DatePart("yyyy",getdate()) + Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) + "_" + Right("0"
+ (DT_STR,4,1252) DatePart("d",getdate()),2) + "_" + Right("0" + (DT_STR,4,1252) DatePart("hh",getdate()),2) + "_" + Right("0" + (DT_STR,4,1252) DatePart("mi",getdate()),2)
+ "_" + Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2) + ".csv"
3) Transfer the CSV file to an FTP site.
4) Delete the CSV file from the 'local' location.
I've been able to do steps 1 and 2 so far. However when trying the move the newly created file to the FTP site I get the error:
"Error: 0xC002917C at Send to FTP, FTP Task: The variable "User::LocalFilePath" doesn't contain file path(s)."
(When I set the "IsLocalPathVariable" to "False" and use a file previously created the file is correctly transferred to the FTP site. This proves that the FTP details are correct and that the "RemotePathVariabe" is working
correctly.)
I have set the variable ("User::LocalFilePath") to "EvaluateAsExpression" in the variable properties.
Can anyone help?
Many Thanks,
UnoT
Hi Vaibhav,
Thanks for your response. I set the "DelayValidation" to "True". However
that didn't make any difference.
I added in all the breakpoints, but it didn't give any results (I may be doing this incorrectly?):
Any other suggestions?
Thanks,
UnoT
Similar Messages
-
Recive a file with dynamic name
Hi All,
I want to receive a file with dynamic name containing date stamp to it.... eg File_20080123.txt , File_20080122.txt etc.
Can anybody suggest how to do it?
Thanks,
AtulAtul,
Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.
Have u tried this option?
See the below Solution
Check the ASMA File for both sender/receiver channels.
Write the below code UDF in mapping program
//Get Input date. Don't pass anything to this UDF except the Date.
//Map the output to the root node of the target.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fname = conf.get(key);
String ret = fname"_"Date
return "";
raj.
Edited by: Raj on Jan 23, 2008 4:09 PM -
How to send file with original name through Mail adapter
I have to send file with original name as attachment through Mail Adapter. I am picking the file from FTP server through File Adapter. I am not using message mapping because files do not have any standard format.
Hi,
Have you solve your problem ?...
I have exactly the same scenario : pik up a file (file adapter) and send it in attachment by mail adapter without mapping (no IR)...
I activated Adapter specific paramters properties in the File adapter sender and i can see the FileName tag in DynamicConfiguration section of SoapHeader in SXMB_MONI...
I want to use MessageTransformationBean... BUT, how can i 'access' to FileName tag ???...
Thanks...
I setup modules like this :
AF_Modules/DynamicConfigurationBean 1
AF_Modules/MessageTransformBean rename
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean mail
1 key.0 write http://sap.com/xi/XI/System/File FileName
1 value.0 message.FileName
rename Transform.ContentDisposition attachment;filename=message.FileName
rename Transform.ContentDescription message.FileName
rename Transform.ContentType application/csv-tab-delimited-table;name=message.FileName
But my file name attachment is message.FileName....
Edited by: Emmanuel JORAND on Sep 29, 2008 9:23 PM
Edited by: Emmanuel JORAND on Sep 29, 2008 10:25 PM -
FTP Activity - mget multiple files with dynamic names
Hello All
Hope all is well.
I was wondering if there was a way to configure FTP activity to transfer multiple files with dynamic names from source location at daily intervals.
For example, my source files are affixed with date values (source_filename_<mmddyyyy>_<hh>.txt):
source_filename_12252009_00.txt
source_filename_12252009_06.txt
source_filename_12252009_12.txt
source_filename_12252009_18.txt
What I would like my process flow to do would be to download just these 4 files once daily based on a dynamic ftp script as follows:
open ${Remote.Host}
${Remote.User}
${Remote.Password}
cd ${Remote.RootPath}
prompt off
mget ????????
quit
In DOS batch script you would have the mget command with a wildcard as:
mget source_filename_%DATE:~0,2%%DATE:~2,2%%DATE:~4,4%*.txt
How does one go about implementing this in OWB? Does it require a user defined substitution varilable of some sort?
FYI, I am using version 10gR2.
Cheers.Hi ,
If you are able to achieve your objective from a DOS batch script then you can call that script for an User Defined Activity in OWB process flow .
Hope this helps.
Thanks,
Sutirtha -
I need to include a page with a name I do not know in advance. I can do this with <jsp:include page="${filename}"/>.
Can I also do it somehow using tag files?Atul,
Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.
Have u tried this option?
See the below Solution
Check the ASMA File for both sender/receiver channels.
Write the below code UDF in mapping program
//Get Input date. Don't pass anything to this UDF except the Date.
//Map the output to the root node of the target.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fname = conf.get(key);
String ret = fname"_"Date
return "";
raj.
Edited by: Raj on Jan 23, 2008 4:09 PM -
How to send File with Same name to Receiver
HI Frnds,
In my peoject i have one scenario,
I have to access Orders is the name of file , available in FTP Server, i have to send same file to Receiver side with same name Orders
Is it possible with same name dynamically??
Regards,
Rajhi,
You have to go for variable substitution option available in receiver file adapter,but for that you have to get the file name in receiver payload.
http://help.sap.com/saphelp_NW04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
these links are also helpful
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
/people/sriram.vasudevan3/blog/2005/11/21/effective-xsl-for-multimapping-getting-source-filenames-in-legacy-legacy-scenarios
regards,
ujjwal kumar -
Pick the file with dynamic name
Dear All
My scenario is file to idoc.
legacy system generates file with a file name as current date.txt which keeps on changing
eg: on 9th july file name is 09072009.txt and
on 10thjuly filename would be 10072009.txt
How do i pick such file and process it?
What should be the File Name in the sender communication channel?
Please help me in resolving this issue
Thanks
BhaskerHello Baskar Raj,
Your requierement can be acheived by using the combination of UDF and ASMA(AdapterSpecifieMessageAttriburrtes) which helps us greatly in meeting dynamic filename rquirements.
1.You have to enable either FIlename,Time stamp or all the he ASMA in the sender side communication channel .
2.Write the UDF that gets the file name (CURRENT DATE.txt)during runtime that is available from enabling ASMA in sender communication channel .
3.change it to the name u want to modify (Replace with the new file name by getting time stamp from the ASMA attributes.
4. Map the UDF output to any of the target nodes(can be messagetype node MT_ur msg type name).
5.Enable ASMA on the target side also in that chek same file name.
Code to be writen in UDF is mentioned by sunilchandra in the below thread u jus need to avoid filename in that and use only date format it will acheive ur requrement.
Re: Regarding Target File name
Thanks,
Ram. -
Ls shows ??.html after creating file with arabic name using java applicatio
Hi,
I have a java application which is taking attachments and saving to the file system. when somebody attaches any file with the file name in arabic, the ls command shows ??.html , ????.html etc. The application is also not able to find the file later, cos it expects the arabic named file. How can I accomplish this task (" how can i rename a text file with an arabic name")
Any help would be highly appreciated
Many thanks in advance
Ushas SymonI found a sample class that also uses HttpServlet and it won't work on my computer Either:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class Circle extends HttpServlet
public void doGet( HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println( "<BODY><H1 ALIGN=CENTER> Circle Info </H1>\n");
try
String sdiam = request.getParameter("diameter");
double diam = Double.parseDouble(sdiam);
out.println("<BR><H3>Diam:</H3>" + diam +
"<BR><H3>Area:</H3>" + diam/2.0 * diam/2.0 * 3.14159 +
"<BR><H3>Perimeter:</H3>" + 2.0 * diam/2.0 * 3.14159);
catch ( NumberFormatException e )
out.println("Please enter a valid number");
out.println("</BODY></HTML>");
}As for IE I tried setting all of my security to the lowest settings I have but it didn't work. I just noticed though that the IE explorer bar at the bottom states :
Exception null.
When the applet is first started. Not sure what to make of that.
I don't think it's a dependancy error because when I make a reference to something that the compiler can't find I get a different error. Or if I miss importing something it just refuses to compile.
I'm wondering if there's something wrong with my Java or the Servlet classes?
Thanks
Ga'an djin -
Posting a File with Date Time using FTP in a BPM scenario
Hi All,
I have got a following requirement within the BPM ::-
Step 1: We receive a file from an external system using FTPS with File Content Conversion Mode. The file is a comma separated file.
Step 2 : We need to write the same file without any changes in data elements to another File System. The file to be written will be comma separated.
Step 3 : The data will be mapped to an RFC and there will be a RFC Call to the ECC system.
Step 4 : On successful call to RFC, the file will be dumped into the SAP File system also.
The issue here is in Step 2. The additional requirement for Step 2 is to name the file with the following convention -
ABCDEF_<Date in MMDDYYYY>_<Time in HHMMSS>_<Time in ms>_data.txt
Can you help me on how to configure this from within the BPM ? I have seen blogs and replies in forum on using UDF's for the same. I am not sure on how to do this in BPM.
Please help !!!
Thanks,
AmitHi,
I dont think you required BPM in this case,you can achieve this requirement using Multi mapping.
3 Receive comunication channels
1)to send file to receive File directory9Content conversion required)
2)RFC Receiver Communication channel to make a cal to SAP ECC to send RFC..
3)One more File communication channel to send data to SAP File System.
refer below blog.
/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
Regarding r file name use dynam ic configuration UDF or ASMA to chnage file name format to your desired format,if you decided to use UDF then map root nod of receiver file structure in multimapping.
Regards,
Raj -
Files with .a extension using ftp transport
Hi.
Am using ftp adapter in osb to read .txt files(e.g. abcd.txt) from ftp location, process the body/text() in OSB and then place the incoming file to an outbound folder.
the flow is like ftp-> Proxy Service->Business Service->outbound ftp
the service works fine where then is less load or the no. of incoming files is less.
However,sometimes the outbound folder contains the files with .a extension at the end.(e.g. abcd.txt.a)
Can someone tell me the rootcause of these .a file creation and the scenarios in which the .a files are created.
Also,please tell me what are these .a files meant for?
How,can I eliminate this while configuring the services using ftp transport.
Thanks in adavanceI had this recently with a variety of FTP servers, FileZilla, Microsoft etc.
For me, it happened when the file already exists in the destination and I was expecting the destination file to be overwritten. My application would generate the same filename, say FileA.txt and expect that to be overwritten, but with OSB 10gR3 I would get files with .a stuck on the end.
This functionality changed between ALSB and OSB and I had a patch developed to restore the ALSB functionality.
I spent ages looking at it, and debugging FTP commands and going from memory, I'm pretty certain that the FTP adapter doesn't implement the correct FTP spec for the RNFR command according to the RFC in the case where a file already exists - it doesn't handle overwrite.
Hope that may help.
Pete -
Source files with dynamic name
Hi,
Is there a way to load from a variable file name sources, for example file name with date postfix, something like this: INPUT_DEPT_20070313.txt ??
Or i must create an external process in the process flow wich is to rename the file every time to a fix name then load ??
Thanks.Correct. If you are using SQL*Loader mapping, then put a transformation before the mapping in your process flow. If you are using external tables (PL/SQL mapping), then put a premapping procedure in the mapping. And yes, use UTL_FILE package to rename the file.
Greetings,
Mate -
How to specify Sql Loader input file with dynamic name
The input file name likes pochange_YYYYMMDD.dat which is generated by other program each day.
I want to load this file to a table.
Any help? Thanks a lotI thought in an excellent strategy to do this:
Conditions:
- you have to have only one file in the folder with the data.
- Independently of the name of that file. A process is always going to change its name to a fix name.
- the controlfile must at another fixed path
the scripts is this one:
joel_sqlloader.bat
ren *.dat always.txt
sqlldr <user>/password data=always.txt control=<another_path>/my_ctl.ctl
- In a folder you will have these files:
* joel_sqlloader.bat
* pochange_YYYYMMDD.dat
- In another folder you will have:
* my_ctl.ctl
Did you get it ?
Joel Pérez
http://otn.oracle.com/experts -
Problem in creating war file with context name using '/'
Hi, I am trying to create a war file and I have given the
weblogic.httpd.webApp.cnt/servlet=C:/weblogic/myserver/warfiles/ in
weblogic.properties file. My war file exists in
C::/weblogic/myserver/warfiles/ directory. Whenever I try to access the page
CPRSEntryServlet I give the URL as
localhost:7001/cnt/servlet/CPRSEntryServlet (as my webservlet context is
cnt/servlet) I get page not found error. Is there anything wrong in giving
the servlet context as cnt/servlet. Does the '/' work..? Please help me..I
have struggling with this since a long time
thanks
YaronYou should set as below
weblogic.httpd.webApp.cnt/servlet=C:/weblogic/myserver/warfiles/<warfilename>
Jacobson Yaron wrote:
> Hi, I am trying to create a war file and I have given the
> weblogic.httpd.webApp.cnt/servlet=C:/weblogic/myserver/warfiles/ in
> weblogic.properties file. My war file exists in
> C::/weblogic/myserver/warfiles/ directory. Whenever I try to access the page
> CPRSEntryServlet I give the URL as
> localhost:7001/cnt/servlet/CPRSEntryServlet (as my webservlet context is
> cnt/servlet) I get page not found error. Is there anything wrong in giving
> the servlet context as cnt/servlet. Does the '/' work..? Please help me..I
> have struggling with this since a long time
>
> thanks
> Yaron
-
Importing From Flat File with Dynamic Columns
HI
I am using ssis 2008,i have folder in which I have Four(4) “.txt” files each file will have 2 columns(ID, NAME). I loaded 4
files in one destination, but today I receive one more “.txt” file here we have 3 columns (ID, NAME, JOB) how can I get a message new column will receive in source. And how can I create in extra column in my destination table dynamically …please help meHi Sasidhar,
You need a Script Task to read the names and number of columns in the first row of the flat file each time and store it in a variable, then create a staging table dynamically based on this variable and modify the destination table definition if one ore more
new columns need to be added, and then use the staging table to load the destination table. I am afraid there is no available working script for your scenario, and you need some .NET coding experience to achieve your goal. Here is an example you can refer
to:
http://www.citagus.com/citagus/blog/importing-from-flat-file-with-dynamic-columns/
Regards,
Mike Yin
TechNet Community Support -
Configure Sender File adapter dynamically
Hi,
I need to configure the sender file adapter dynamically. Ex: I will be providing the src dir , file name etc dynamically. I think this is not possible using module because module gets executed after file is picked (in my case file dir and file names need to be determined dynamically). I even don't won't to use directory API for craeting my file sender comm channel. Is there any other way to achive this.
Regards,
RakeshHi Rakesh,
what is the Operating system of the PI server? Could you please kindly explain what conditions determine filename and source directory? I do not think there is anyway you can determine src file and dir names dynamically in PI.
Here is what you can try.
PI server is on windows system u need batch file. If its on unix or Linux you need scripts. Now what you have to do is place all files in a directory. Here the script/batch file will run continuously in background. Once it gets files it will rename files based on file content or file name then move them in different directories as per your conditions. your interface must have multiple communication channels and sender agreement (with diffrent parties) which will pick up those files from these directories.
The name of directories will be fixed in each channel.
regards
Anupam
Maybe you are looking for
-
How to use sub folder paths for external table location parameter?
is it possible to use one Oracle directory and address multiple files under some OS sub-directories beside that Oracle directory? Like; host mkdir /tmp/orcl_dir host mkdir /tmp/orcl_dir/fold1 host mkdir /tmp/orcl_dir/fold2 CREATE DIRECTORY ext_tab_di
-
Field length in internal table
hi, how to selt field length in internal table?. i have created on report the report out puts down load to using download function . the out format is: op1 op2 op3 op4 1 3 4 i want op1 op2 op3 op4 1
-
does Pages support an export to PDF files with videos embedded?
-
Please answer my query in Java Programming
Please people, no one is answering it there!!!
-
HT1349 No sound while playing music or in other programme but there is not problem to call
No sound while playing music or in other programme but there is not problem to call