Read the AS400(on IFS) directory for filenames with wildcard

Sandeepa

Member
Requirement is to read the flat filenames from a directory which is on AS400(IFS – Integrated File System), and store the filenames in the flat file in the same directory of the IFS system.

For example:-
Directory is \export\ -> having file names such as SAMABC.txt, SAMXYZ.txt and TestABC.txt. JDE UBE would be triggered which will read this directory for SAM* and would result in creating a file(Print.txt) in \export\ directory. This Print.txt will store file names SAMABC.txt and SAMXYZ.txt.

JDE BSFN which are available for taking care of this is only Client and the API’s used are Windows specific.

I am thinking if I can use the BSFN Execute External Command where I would be providing the command of AS400/OS400, which would filter the filenames based on the search criteria given with wildcard and store the filenames retrieved in the same directory under a new file(Print.txt).

I had tried the commands on windows using the BSFN Execute External Command which works perfectly but I am not able to find the specific commands for OS400.

Please let me know if you can provide the relative information regarding the OS400 commands which would take care of this requirement, it would be of great help.
I did tried copying the BSFN which were client only to Client/Server but they are failing during the package build.

I am not very much sure whether the OS400 commands would work through the Execute External Command BSFN, please advise.
 
Sandeepa,

You may want to try B34A1030 - Execute External Program. You can put all the AS400 commands that you want to run in a CL program. Build a string in the UBE to submit this CLP as you would do from AS400 command line. Use this string as parameter to B34A1030.

Take a look at the Business Function notes for any set up info.
 
I tried Execute External COmmand using QSH CMD('find /export -name "GL*" -type f > /export/output.txt')

The file is getting created, but I am getting error while reading this file. I am not even able to view this file in .txt format on the IFS also it is showing some junk characters.

Does anyone know if any JDE BSFN available to read the fielnames using wildcard characters pattern, or any API's which can be used with custom build to achieve this.

Also does the comamnd needs to be modified or tweaked to get the correct result.
 
Sandeepa,

If I understand, correctly, your 'output.txt' flat file is being created correctly - but you can't read it within E1?

Have you configured your Unicode / flat-file processing correctly for the table? If it looks like junk, it's ... probably ... being read as the wrong character set.

There are a lot of Posts about about the process:
http://www.jderesearch.com/tips-traps/tipstrapsflatfile

In the example from JDE Research, that text that is double-spaced could be complete gibberish, if you are using the wrong character set.
(db)
 
Back
Top