adding a date to the name of an output file

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.

adding a date to the name of an output file

Postby mark_a_hall » Fri Mar 15, 2013 11:06 am

Is there an easy way to add the date to the name of an output file. I am pulling data from the IBM i and writing it to the ifs as a CSV file (also ftp'ing it somewhere else).
mark_a_hall
 
Posts: 1
Joined: Fri Mar 15, 2013 10:56 am

Re: adding a date to the name of an output file

Postby Support_Rick » Fri Mar 15, 2013 1:19 pm

Mark,

There are several ways to do this ... try something like this:

Code: Select all
<project name="Date Test" mainModule="Main" version="2.0">
   <module name="Main">

      <createWorkspace version="1.0" />

      <timestamp version="1.0">
         <format outputVariable="DateStamp" pattern="yyyyMMdd.HHmmss" />
      </timestamp>

<!-- Need to create the SQL Rowset of Data "MyRowset" here -->

      <writeCSV label="Create CSV File" inputRowSetVariable="${MyRowset}" outputFile="MyFile.csv.${DateStamp}" whenFileExists="overwrite" outputFileVariable="MyCSVFile" version="1.0" />

      <sftp label="Connect to Server" resourceId="Test SFTP" version="1.0">
         <put label="Push CSV File to Server" sourceFilesVariable="${MyCSVFile}" destinationDir="/" />
      </sftp>

      <deleteWorkspace version="1.0" />

   </module>
</project>
Rick Elliott
Sr. Product Specialist
(402) 944.4242
(800) 949-4696
Support_Rick
Support Specialist
 
Posts: 107
Joined: Tue Jul 17, 2012 2:12 pm


Return to Community Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron