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

WILD CARD char in file Name

Hi all,

I'm trying to use the wild card character "" in file name to read files from App server using open dataset st.If the file name is 2005stcjk.txt ,and if i use wild card like 2005.txt it should be able to pick that up.I tried and i'm not getting this to work.

Is ther anything i'm missing,i guess it's possible.any help is greatly appreciated.

Thanks,

Gopal.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2005 at 06:41 PM

    I don't think you can specify a wildcard in a filename since the system would not understand which file to pick up & hence the open dataset will fail.

    If you have a requirement for reading files using wildcard characters from the app server, you will first have to determine the actual filenames using a separate routine (by using the SYSTEM function to run Unix command ls to list all the filenames matching the wildcard), get these filenames in an internal table & then read each one sequentially.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 21, 2005 at 06:42 PM

    You cannot do that. Open dataset works with only one file at a time and the filename and directory should be valid.

    You can use EPS_GET_DIRECTORY_LISTING function module to get the list of files in a specific directory. You can then loop at that internal tables with file names, and do a READ DATASET on each of those files. Remember, this function module is used on the administrative side, so you need proper authorizations to use function module. Otherwise you will get a blank internal table. Also, you can do a search with wild card only with * at the end, not any other way.

    Hope this helps,

    Srinivas

    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.