Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Copy

Status
Not open for further replies.

softdealer

Technical User
Joined
Mar 16, 2004
Messages
8
Location
US
We have been currently using a map for a file copy process. Currently it will process the data then archive them in this structure \\servername\folder1\folder2\year. Problem that I have is I have to manually change all the maps to switch the year. How can I do it so that it reads the sys year and wont have to modify the maps?
 
Hi

You could declare a field as Date with YYYY as the pattern and then use the CURRENTDATETIME function to retrieve the year.

HTH

Arun
 
In a rule you could use
Code:
"\\servername\folder1\folder2\" + FROMDATETIME(CURRENTDATE(),"{CCYY}")

YM
 
If the input file is the file your want to copy, in an output card field:

=PUT(“FILE”, “\servername\folder1\folder2\” +
WORD(WORD(GETFILENAME(inputfilecard),"\",-1),"."1) +
FROMDATETIME(CURRENTDATE(),"{CCYY}")+".txt", PACKAGE(inputfilecard))

I believe I had some problems at one point with all the functions in one output field, so I built the values in the other output fields before I did the put:

outfield1=WORD(WORD(GETFILENAME(inputfilecard),"\",-1),"."1)
outfield2=FROMDATETIME(CURRENTDATE(),"{CCYY}")
outfield3==PUT(“FILE”, “\servername\folder1\folder2\” +outfield1+"_"+outfield2+".txt", PACKAGE(inputcardfile))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top