Skip to Content
author's profile photo Former Member
Former Member

How do I use BODS 4.2 to wait for folders similar to wait_for_file?

I need to be able to process folders in a parent folder. The parent folder will always be named the same, but the sub folders will be named uniquely as they have a datetime stamp within their name. I use the wait_for_file function to wait for uniquely named files, can I get it to work for folders, then within that while, I can use wait_for_file.

Folder - Parent (a shared folder on the network)

Folder - 123445.201602040813.abc (sub folder)

a.xml

b.xml

c.xml

Folder - 98765.201602040956.xyz (sub folder peer)

1.xml

a.xml

In this scenario, I need to loop over the sub folders then fall into a sub while loop on the *.xml files. I know how to process over the files, but is there a built-in function to similarly loop over the sub folders?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2016 at 05:17 PM

    I don't think so. You might need to write some os level script in order to achieve this. just a simple script to return number of sub folders in the parent use while loop and sleep command to achieve wait_for_file functionality. and another script to get the folder names for selective processing.

    shell - How to find number of Subdirectories under a given directory - Unix & Linux Stack Exchange

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 17, 2016 at 11:00 AM

    On Linux, a folder is just a special type of file.

    Have you tried wait_for_file with the folder name as a parameter? Doesn't that work?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2016 at 04:11 PM

    Hi Dirk,

    I have a similar requirement where I have 5 folders (for example) in a folder . The files will be FTPéd in these 5 sub folders in different time intervals (based on time zones)

    How can I use wait for file in such a way that the while loop will check each subfolders for some time interval and once the file is available it will process to a table .

    This wait for file job should run all day since the folders will receive files based on time zones.

    I am planning to use a variable like a handshake such that on a particular time the data from the table will be further pushed to BW.

    Is my approach correct ? Please help

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.