Read Directory on AS400(IFS) through J.DEdwards Enterprise One

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.
Also need the executable OS400 commands to get the filenames for the wildcard pattern.
 
Your best bet would be to use Shells script in os400 which has all Unix command or you can write a RPG program which can go the job for you, you just call it from your jde program. I coudnt recall any command in os400 which can give you list with wildcard name.

Chan
 
Sandeepa,
This doesn't answer your question directly, but a user on the AS/400 with *ALLOBJ special authority can use the RTVDIRINF and PRTDIRINF CL commands. RTVDIRINF will collect information on all files in \export\ into database files whose names & destinations you control. Then the OBJ parameter of the PRTDIRINF command can be used to narrow the report results to the SAM* files.

The following is from the help text for the RTVDIRINF cmd:
To get the most accurate results, this command should be run at a time when there is very little activity for files in the specified directory. If SUBTREE(*ALL) is specified, try to run this command when there is very little activity for files in all subdirectories of the specified directory.
Note: If there is more than one member in the files, the results of running this command can be unpredictable.
Restrictions:
o Directory information can be retrieved only for mounted file systems.
o Directory information can be retrieved only for local file systems.
 
Back
Top