cancel
Showing results for 
Search instead for 
Did you mean: 

Using Timestamp [TS] in the output file name

Former Member
0 Kudos

Hello Everyone,

i am trying to get the timestamp into the output file generated by the store file atom. Since my Outbound channel is void i thought i could use:

[TS]

or

[yyyy][mm][dd][hour][min][sec]

My File Specification is: C:\Temp\Out\blabla[TS].xml and unfortunatelythe outputfile are named: blabla[TS].xml

What am I doing wrong? Can i not use those placeholders in an atom?

Help is greatly appreciated

Best regards

Simon

Accepted Solutions (1)

Accepted Solutions (1)

bastian_schaefer
Active Contributor
0 Kudos

Hi Simon,

please just use the system variable "$today", this will create an actual timestamp.

The File specification can look like this: C:\Temp\Out\blabla$today.xml

Best regards

Bastian

Former Member
0 Kudos

Hello Bastian,

thank you for your reply. If i use $today it appears in the filename but does not create a timestamp. Maybe im doing something entirely wrong there but i do not know what.

Best regards

Simon

bastian_schaefer
Active Contributor
0 Kudos

Hi Simon,

Now I see, you're trying to maintain the timestamp in the SLD FILO section and not in a store file atom of an integration scenario.

In this case, please check the following help document:


filePattern

To define the outbound file pattern, define the directory and the file specification. Enter the full path. The integration framework supports Microsoft Windows UNC (Universal Naming Convention) names. The directory you enter must exist in the file system. The user for directory access must have the necessary rights in the file system.

You can use the following special characters and variables:

Character/

Variable

Description

?

To introduce  numbering in the file directory use ?.

If you enter  for example data????.xml, the integration framework creates an outbound file called data0000.xml, if the directory is empty. If a file, following this naming  convention, already exists in the outbound directory, the next generated file  name is data<last  number>+1.xml. If data0000.xml already exists in the directory, the next file in the directory  is data0001.xml.

[vbiu]

This is a placeholder for a value you can  define in scenario package processing. If you use the value, add the b1im_filename attribute directly in the outbound payload.

<xsl:template  name="transform">

      <xsl:attribute  name="b1im_filename">myName</xsl:attribute>

      ...

</xsl:template>  

[TS]

To add a  timestamp to the file name, use the variable. This gives you another  possibility to define unique file names.

[yyyy]

Adds the  current year in four digits to the file name

[yy]

Adds the  current year in two digits to the file name

[mm]

Adds the  current month to the file name

[dd]

Adds the  current day to the file name

[hour]

Adds the  current hour to the file name

[min]

Adds the  current minute to the file name

[sec]

Adds the  current second to the file name

You can also combine the variables. For example file[TS]??.[hour][min].txt

Here is a screenshot of my SLD FILO definition and from the result:

Best regards

Bastian

P.S.: just in case you need to define a filename in the integration step for the store file atom, here is a screenshot:

Former Member
0 Kudos

Hello Bastian,

actually i am using the store file atom. Your hint with the variables did the trick. I can use $today and $now to create the timestamp i wanted.

A sidenote: $today first didnt work because i used the active step modification option, which cause weird behaviour at some point. De- and reactivating then solved the problem.

Is there a way to format the timestamp somehow? That would be good to know. For some reason the $now does not show the seconds.

Anyway, thank you very much for the great help you provided.

Best regards

Simon

Answers (0)