Skip to Content
avatar image
Former Member

How to change timestamp ?

We have scenario proxy to file(SFTP) PI 7.1

For each trigger from proxy...data is split into 3 files (multimapping used) with filenames as :

abc<yyyyMMdd_HHmmss>.txt

def<yyyyMMdd_HHmmss>.txt

xyz<yyyyMMdd_HHmmss>.txt

The timestamp should be same for all three files for each trigger.

Now the issue is that even if PI takes one more second for any of the split to process, the timestamp will vary by 1 second.

e.g. for each trigger filenames should be:

abc20140606_125417.txt

def20140606_125417.txt

xyz20140606_125417.txt

if the delay in processing of any of the split is by one second..filenames will be:

abc20140606_125417.txt

def20140606_125418.txt

xyz20140606_125419.txt

As proxy is triggered a number of times a day, I cannot hard code the time part in timestamp.

Can anybody help me in meeting this requirement ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 06, 2014 at 07:06 PM

    Hi Saurabh,

    If you are using dynamic configuration for file name and setting the file name in mapping, then set the second to 00 in UDF.

    regards,

    Harish

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 06, 2014 at 09:44 PM

    Hi Saurabh,

    IMO, it is not possible to meet this requirement through a standard solution.

    However, What you can do is, let PI create the files in a temp folder with the timestamp (obviously millisecs would change) and get Basis to create a script that move the files to another folder with the timestamp you need by simply copying the time from the first file created to the other 2 files...

    it may also happen that one of the 3 files is created in a different second. This will cater to that eventuality as well.

    Cheers

    Ambrish

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Try the below option.

      Add the time stamp to a field in target side payload in mapping .Use this field value to set the file name in your module.

      Now to remove the field in your target structure use "RemovePayloadValueBean" in your channel.

      Regards

      Venkat

  • Jun 08, 2014 at 04:32 PM

    Hi Saurabh,

    If this is triggered via proxy then why not simply add a timestamp as a parameter within the proxy that would be used via each mapping?  That way you don't have to worry about how long it takes for PI to process the files.

    Regards,

    Ryan Crosby

    Add comment
    10|10000 characters needed characters exceeded