cancel
Showing results for 
Search instead for 
Did you mean: 

How to pick file for reading in sequence based on timestamp in XI?

gopalkrishna_baliga
Participant
0 Kudos

Hi Experts,

I have a XI scenario where it first reads input file from the shared folder. The problem is that there will be many files at a given point of time. For example:

Here there are three files. The file name has datetime(MMDDYYYYHHMMSS) stamp at the end.

hsdinput-01012011110000.xml

hsdinput-01012011100000.xml

hsdinput-01012011111500.xml

Now I want my file adapter should read files in sequence based on the timestamp.

That is in the following order

hsdinput-01012011100000.xml

hsdinput-01012011110000.xml

hsdinput-01012011111500.xml

So is this possible in sender file adaper? What all setup or configurations I have to do in sender file communication channel to achieve this?

Thanks & Regards

Gopal

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can set in sender CC the parameter Processing Sequence = By Date

After that use Quality of service as EOIO and provide one queue name. Use same queue name in the receiver comm channel as well. So files will be picked by the date of the file and messages will be passed to SNC system in "first in first out" basis.

● Processing Sequence (for transport protocol File System (NFS))

If you used placeholders when specifying the file name, define the processing sequence of the files:

○ By Name: Files are processed alphabetically by file name.

○ By Date: Files are processed according to their time stamp in the file system, starting with the oldest file.

(http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm)

gopalkrishna_baliga
Participant
0 Kudos

Hi spantaleoni,

What is the acceptable timestamp format so that file is picked properly in sequence by date/time?

Can the file name have hsdinput-yyyMMdd-hhMMss.xml format?

Thanks

Gopal

Former Member
0 Kudos

Hello Gopalkrishna,

Files are processed by their last modification time stamp, where the oldest file is processed first.

This could work fine for your requirement?

gopalkrishna_baliga
Participant
0 Kudos

Hi spantaleoni,

So do you mean that it does not matter what the file name is and if it contains timestamp at the end or not?

Thanks

Gopal

Former Member
0 Kudos

Hi,

The timestamp in the filename is not considered. Its the last processed timestamp of the file stored in the DB that is taken into consideration when picking the files.

Regards

anupam_ghosh2
Active Contributor
0 Kudos

Hi Gopal,

try setting the processing sequence by name. The files will be picked up alphabetically by name only. For example

hsdinput-01012011111500.xml

hsdinput-01012011110000.xml

hsdinput-01012011100000.xml

are three files in the folder PI should pick it up in this sequence

hsdinput-01012011100000.xml

hsdinput-01012011110000.xml

hsdinput-01012011111500.xml

Now this can be solution to your problem provided all files that PI needs to pick up in order are available in the folder simultaneously. if the files are being put in random order and with some effective delay then there is a chance of missing the sequence of reading the files. Say for example at some point of time the folder contains these files

hsdinput-01012011111500.xml

hsdinput-01012011111501.xml

PI server will read this in order.

Now again if you put these files say

hsdinput-01012011111400.xml

hsdinput-01012011111502.xml

hsdinput-01012011111300.xml

then PI will read these files in following order

hsdinput-01012011111300.xml

hsdinput-01012011111400.xml

hsdinput-01012011111502.xml

Therefore the finally for all file the order becomes

hsdinput-01012011111500.xml

hsdinput-01012011111501.xml

hsdinput-01012011111300.xml

hsdinput-01012011111400.xml

hsdinput-01012011111502.xml

But you wanted to read in this order

hsdinput-01012011111300.xml

hsdinput-01012011111400.xml

hsdinput-01012011111500.xml

hsdinput-01012011111501.xml

hsdinput-01012011111502.xml

The delay in putting all the files at one time will cause the errors.

To overcome this problem you can use scripts which will place the files in proper order in the folder from where PI picks it up.

The script will work along with the "processing sequence by name" option turned on.

regards

Anupam

Former Member
0 Kudos

I agree with Anupamsap to use ByName if you have to process files ordered by "name-timestamp".

Otherwise, use ByDate if you have to process files ordered by date.