premavani
asked on
How to retrieve file names from AS400 directory
Hello,
We need to get only file names from AS400 directory. Is there anyway to get job number of a specific job?
EG: We have created a spool file with default name that has a job number that identifies different spool files.
How to retrieve this job number during the file creation time?
Eg for 1st situation: We have created a directory in AS400. The files keep on adding to the directory. How to retrieve all these file names at any time?
Please respond quickly.
Thanks in Advance
We need to get only file names from AS400 directory. Is there anyway to get job number of a specific job?
EG: We have created a spool file with default name that has a job number that identifies different spool files.
How to retrieve this job number during the file creation time?
Eg for 1st situation: We have created a directory in AS400. The files keep on adding to the directory. How to retrieve all these file names at any time?
Please respond quickly.
Thanks in Advance
ASKER
Hi Murph,
DSPOBJD will retreive file names that are there in the library.
I want to retrieve file names from an AS400 directory.
EG: we have created a directory called tmp in AS400. In that directory we have kept few xml files.
To process these files, we need the xml file name. Is there any CL command to retrieve these file names?
Please respond ASAP.
Thanks
Prema
DSPOBJD will retreive file names that are there in the library.
I want to retrieve file names from an AS400 directory.
EG: we have created a directory called tmp in AS400. In that directory we have kept few xml files.
To process these files, we need the xml file name. Is there any CL command to retrieve these file names?
Please respond ASAP.
Thanks
Prema
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Note that Raj was specific in requesting a list of "directory" file names and not "library" file names.
Tom
Tom
First: We need to get only file names from AS400 directory
Just run the dspobjd command:
DSPOBJD OBJ(MYFILELIB/*ALL)
OBJTYPE(*FILE)
OUTPUT(*OUTFILE)
OUTFILE(MYLIB/FILELIST)
Now you have a file FILELIST in library MYLIB. and you can browse the contents.
if you just want to have the file names run a query or copy the file with *MAP *DROP option
to a new file by:
creating file ODOBNM with CRTPF FILE(MYLIB/ODOBNM) RCDLEN(10)
And copy the contents of the FILELIST with:
CPYF FROMFILE(MYLIB/FILELIST)
TOFILE(MYLIB/ODOBNM)
MBROPT(*REPLACE)
CRTFILE(*NO)
OUTFMT(*CHAR)
FMTOPT(*MAP *DROP)
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
About the jobnumber:
type WRKACTJOB
and press 2 times the F11 there you see all the jobnumbers.
Regards,
Murph