Page 1 of 1

Sequential File Stage file name

Posted: Tue Jul 22, 2008 12:47 am
by taufik
Dear All,

I need to create job that read file generated every 15 minutes. The file name was generated base on time file generated, e.g. rec20080701132610 and next 15 minutes file rec20080701133110 (recYYYYMMDDHHMISS) was generated.

All I know that we need to write filename explicitly in Sequential Stage. Is there anyway so I can throw kind of filename variable for Sequential File stage, so the stage read "current time" file only?

Thanks in advance,
Taufik

Posted: Tue Jul 22, 2008 12:56 am
by ray.wurlod
Yes, but exactly how depends on your actual requirement. For example if you always want the latest file, capture its name with an operating system command like ls -lrt dirpath | head -1 or DIR /OD/4 dirpath | SORT /R in an Execute Command activity (in a job sequence), then capture that output to feed to the filename job parameter in a Job activity. You will probably need to strip field mark characters (@FM) from the command output.

Posted: Tue Jul 22, 2008 1:15 am
by taufik
Where should I put those command? There is filter command text box on sequential file properties window, but looks like it's disable to edit.

Posted: Tue Jul 22, 2008 1:44 am
by ray.wurlod
In a job sequence.

Code: Select all

ExecuteCommand --->  Job activity

Posted: Tue Jul 22, 2008 3:36 am
by sachin1
Sorry Ray but i have one doubt how can he execute 'ls' commandS when his OS is windows.

Posted: Tue Jul 22, 2008 3:56 am
by ray.wurlod
That's why I also gave a DIR command. Many Windows sites have a UNIX emulator such as MKS Toolkit that could be used to execute the ls command.