105 pts.
 List of files in Directory on the IFS
I have files on the IFS in a directory /EDIIN. I need to have a program send the files based on their name to diffent locataions. Is there a way I can get a list of those file outputed to a DB so I can read through it.
ASKED: May 14, 2009  5:09 PM GMT
UPDATED: May 15, 2009  12:37:19 PM GMT
2,385 pts.

Answer Wiki:
Hi,

take a look to this web page.

http://www.scottklement.com/rpg/ifs.html

Regards,

Wilson
Last Wiki Answer Submitted:  May 14, 2009  5:13 PM (GMT)  by  WilsonAlano   2,385 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _




 

Editor’s note: Emadkaradsheh saw the response and posted a new question related to the original. I have deleted that post and pasted his response here:

I asked the question earlier and got a response. I need an “EASY” to be able to copy all the files in a directory (I will not know the file names) to an ASN file or library. Are there any commands I can use to do that without having to write RPG programs. I just need a list of files in that directory, and then I can use cpyfrmstmf to bring them into an AS/400 DB.

 4,265 pts.

 

There is no an “EASY WAY” to do that. No such command available. You must write a program (CL or RPG) using APIs or look for a commercial tool.

Regards,
Wilson

 2,385 pts.

 

Retrieve Directory Information (RTVDIRINF)

Type choices, press Enter.

Directory . . . . . . . . . . .

Directory subtree . . . . . . . *ALL *ALL, *NONE
Information file prefix . . . . *GEN Name, *GEN
Information library . . . . . . QUSRSYS Name

Will list the files in a directory in a database file the command creates.

 2,865 pts.

 

Hi DanD,

It’s a great command I didn’t knew till now. It will solves Emadkaradsheh problem!

Thanks!

Wilson

 2,385 pts.

 

thank you. That seems to have put the data into an AS/400 file, but I am not sure what kind of data it is. I was expecting a file that I could query, but I assume the file is not a DB2 file.
Am I doing something wrong, or is there another step to copy the file.

 105 pts.

 

The file created by the command is a queriable(word?) database file. I don’t know why you would have a problem, but do F1 the “Information file prefix . . . . *GEN Name, *GEN” and read the help. The command outputs two files with different level of information, but runqry works on both.

 2,865 pts.