cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic sender file name

Former Member
0 Kudos

Hello,

we have scenario File --> XI --> proxy, where XI picks up the file from a folder. The file is generated by some job once per day. The file name should be xxxdate.txt, for example, suppose today is Dec. 25, 2008, then the PI should pick up the file xxx20081225.txt. My questions is how to specify the file name in the sender CC.

The only solution I can come up is to specify \*.\* as file name and have a UDF in the mapping to check the send file name, only if hte file name contains today's date, a target message is generated. However this is not good solution, suppose the folder contains 1000 files, PI would pick up all the files un-neccessarily.

Anyone has good idea?

Jayson

Accepted Solutions (0)

Answers (2)

Answers (2)

VijayKonam
Active Contributor
0 Kudos

Why dont you ask you file generating system to put an initial character in the file name so that you can specify like A.. Otherwise cant they put just these file in a sub folder?

Because date is a variable in the file name. so it is as good as . itself..!! I think the only solution possible.. you have already given it..!!

VJ

Former Member
0 Kudos

Hi Sudhir

variable substitution is only for receiver CC, not for sender.

VJ, the sender belongs to another system, we have no influence on them, we can only take what they currently have, can't ask them to change their program/job.

Really, there is no better solution for this?

Jayson

Former Member
0 Kudos

Hi Jayson,

What is the XI file polling interval ? what is "xxx"? Is it constant ?

Thanks,

Pooja

Former Member
0 Kudos

Hi Pooja,

polling interval is one day as file is generated once per day. xxx is a constant.

Jayson

Former Member
0 Kudos

Hey Jayson,

If the polling interval is once per day, then you can set the file name as "xxx*.txt" and set the processing mode as "Delete".

With these two conditions you will avoid the duplicate processing of the files as well as you wont be getting the non-xxx files.

Thanks,

Pooja

SudhirT
Active Contributor
0 Kudos

jayson,

sorry for misunderstanding.If xxx is constant not a variable then you can give filename as xxx*.txt. otherwise i dont think there is any good solution.

thanks.

Former Member
0 Kudos

Hi Jayson

If i understood your requirement correctly. you want to pick files for a particular date only?

To do this you can write a simple module which picks files for a particular date only.

If the problem is you dont want to use .txt then as said above use xxx.txt. You can set the criteria you want to pick these files.

Thanks

Gaurav

Former Member
0 Kudos

Hi Pooja,

as said, the sender belongs to other system, we are NOT allowed to delete the file, those files are maintained by other group.

Sudhir, I want to pick up only one file, as picking up all files is not what I want.

Gaurav, even with a module, all the files would be picked up to the java module for check, which is again not what I want.

I guess, there might be no perfect solution for it. Just specify xxx*.txt, and let mapping UDF program to ignore non-today's file.

If anybody has better idea, I'd appreciate it.

Jayson

Former Member
0 Kudos

Hi Jayson

Right now also you are doing similar thing as i asked for Adapter module.

You are picking the file *.txt and then rejecting the data based on UDF.

To make it mapping independent i suggested to go for adapter module. You can check the files in folder itself and can pick only the file you require. It will traverse through the complete folder.

Looking at one more aspect. Only one file will be send from AE to IE.

Well i most of the times use Unix scripts for such purpose. I would have pick todays file from source to another folder and pick files from that folder. Keeping PI away from coding and let the job done at server end itself.

Thanks

Gaurav

Former Member
0 Kudos

Gaurav, I think you are right. That might be the best solution. I'm closing this post.

SudhirT
Active Contributor
0 Kudos

Probably

you can use variable substitution and pass the current date in one of additional target field and use this in variable substitution.

thanks.