Use time stamp and source name in target
I think I figured out that I can place an activity line from the source file node to the target and it will generate the file. The problem is that is "seems" like the target file is getting overwritten, even through I am using a time plate in a context variable to rename the file. The process runs so fast that two files run within one sec and I need (obviously) two files.
-
As per your first request you can try using the inbuilt “Time Stamp” functionality of File Target activity to create unique files instead of using context variable (which you might not be using correctly).
Select “HH-mm-ss.SSS” pattern from second drop down list provided against “Time Stamp” functionality wherein different files would be created even if they are created within the same second.For more information you can also refer to “CREATING FILE TARGET ACTIVITY” section in Developer’s Guide.
To “attach the original (source) file name to the target”, please do the following:
Use Put-Context-Var before the file target activity in PD and specify
a) Activity Name : FileTarget
b) Variable Name : fileName
c) Variable Value : $$Service.FileSource.fileName$$
(“FileSource” and “FileTarget” would be the names of File Source and File Target activities respectively).
At the Target end, UNIQUE files would be generated. Name pattern of the target file would look something like “FileSource_06-05-59.313_010255001011134156915931310124” wherein Time Stamp and Unique Id are appended after the source file name.0
Please sign in to leave a comment.
Comments
1 comment