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.
2 posts Page 1 of 1


Posts: 1
Joined: Fri Mar 15, 2013 10:56 am

Post by 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).


Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Fri Mar 15, 2013 1:19 pm

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" />

<!-- 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="/" />

		<deleteWorkspace version="1.0" />

Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1