Find First File Matching Wildcard BSFN

AlanParsons

Member
Hi List,

I used the BSFN "Find First File Matching Wildcard"-(B9600471) on one of my UBEs to retrieve the complete Text File Name from a specific path by passing an incomplete File name followed by Wildcard(*). The BSFN works absolutely fine on the FAT Machine. Once deployed on the Server it fails to retrieve the filename.

After some investigation I came to know that it is a CLIENT ONLY BSFN. I copied the BSFN and made it a Client / Server (2), build / deployed it on the Server but still the results didnt show up. After going through the codes, i found out that some of the APIs embedded within seem to be working only on WINDOWS Client and mine is an AS/400 server.

I Build / Deployed the UBEs and the BSFN on one of my Windows Transfer Server. Still it FAILS!! Does anybody know what am i missing to make it run on the SERVER.
How can i make the same BSFN work on AS / 400 Server?

Is there any other method which can give me the complete filename if i specify a part of the filename followed by a wildcard? I need to read all the filenames that matches the incomplete filename with wildcard!

Thanks in advance.
smile.gif
 
Hi,
First of all your AS/400 enterprise server should see a windows file system... and this is the general problem.
Flat file operations that use STDIO call will work on win and unix, windows only calls only on win, but none of them on AS/400. As far as I know this bsfn uses a windows library function.
Regards
Gergely Pongrácz
 
Hi Gergely

Thanks for the information. These are the APIs _findfirst,_findnext,_finddata_t in the BSFN and looks like they are Windows compatible ONLY.

Is it possible to make it run on the Windows SERVER if i create a copy of this Business Function and turn ON the Client / Server Option?

What else can be a possible solution for my requirement?

Thanks in Advance!
smile.gif
 
First, what do you mean you built and deployed the UBE... on the Windows Transfer Server...did you OCM map it to run on the Windows Transfer Server? Just because you deployed it on a machine, it will still run on the default machine unless you override it, right?

If you want it to run on the AS400 you need to rewrite the Windows APIs functionality on the AS400 and have it accommodate the AS400 file structure (or whatever the proper term is).

Ben again,
 
If you have a windows server with JDE services running on it, you should be able to make a copy of that function, define it as a client/server function, and run it on the windows server. Use OCM mappings to direct it to the windows box.

If you want it to run on the AS/400, you will have to find IFS-specific apis that mimic what the windows-specific apis are doing. Take a look here: IFS API's

Also, I recommend submitting a question to the following forum: IFS Forum Ask if there is any IFS equivalent of those windows functions and be sure to tell them you are using the c-language.

Good luck and please let us know what you find.
 
Hi All,

Thanks a lot for your valuable suggestions. It was difficult for me to check for an equivalent API in IFS for the Windows APIs _findfirst and _findnext. Nevertheless, my issue is resolved as I made the Business Function run on the Windows Server rather than AS400. It works perfectly fine. Thanks a lot again for all your inputs!!!!!
 
Hello,

I have the same problem but with a linux server. Anyone know how I can find files with wildcard characters in a linux server?. I try to found a BSFN, but all are about Windows servers.

Thanks in advance..
 
Hi Arturo,

For unix try using the fnmatch api. Setup a pointer to the directory and pass the api the wilcard you want to search against. You'll need to include dirent.h and fnmatch.h. I'll try and post some code if I get a chance.

Regards

Neil
 
Not sure with Linux but i think a one line shell script will do the job

Chan
 
Need Help

Hi All,

Thanks a lot for your valuable suggestions. It was difficult for me to check for an equivalent API in IFS for the Windows APIs _findfirst and _findnext. Nevertheless, my issue is resolved as I made the Business Function run on the Windows Server rather than AS400. It works perfectly fine. Thanks a lot again for all your inputs!!!!!

Hi Alan,

Any chance you have the copy of BSFN you made to run on the Win Server, if you can attach it would be great, I tried copying the BSFN and make it Client server but it is giving me error.

Thanks in advance
 
Back
Top