Hi,
as subj. says I need help working with files on IFS.
I have a folder on IFS "/home/mydir"
this folder is used to FTP files onto AS/400 for further processing,
basically I get the file from FTP server and import them into database.
the files are CSV type.
I use CL to run FTP script to get the files in the folder and RPGLE program to import the data into appropriate PF/Tables as needed.
the ftp script also generates the file list to describe what files will need to be processed. this is needed since I get 2 distinct file types in the process and each needs to be properly processed into PF.
now I want to move all processed files into a sub-folder "/home/mydir/processed"
currently as my RPG program processes the file it adds the record to a TXT member which is later used to create an FTP rename script
that I use to move the files. I want to eliminate the FTP part and use native CL code to move this files
how do I do that?
the idea is that after I process all data into PF I can use the same file list I used for processing to move the files into sub-folder.
right now I do that by building and the ftp script based on the list and than calling a CL with the script as input. can I simply read the file list in the CL and build a move command for each entry?
OR
can I get the dir listing with in the CL based on wild card and use the output in a loop to build a move command?
PS: if I can get the IFS dir list within RPGLE program and used that for processing it would also help streamline the process.
thanks
as subj. says I need help working with files on IFS.
I have a folder on IFS "/home/mydir"
this folder is used to FTP files onto AS/400 for further processing,
basically I get the file from FTP server and import them into database.
the files are CSV type.
I use CL to run FTP script to get the files in the folder and RPGLE program to import the data into appropriate PF/Tables as needed.
the ftp script also generates the file list to describe what files will need to be processed. this is needed since I get 2 distinct file types in the process and each needs to be properly processed into PF.
now I want to move all processed files into a sub-folder "/home/mydir/processed"
currently as my RPG program processes the file it adds the record to a TXT member which is later used to create an FTP rename script
that I use to move the files. I want to eliminate the FTP part and use native CL code to move this files
how do I do that?
the idea is that after I process all data into PF I can use the same file list I used for processing to move the files into sub-folder.
right now I do that by building and the ftp script based on the list and than calling a CL with the script as input. can I simply read the file list in the CL and build a move command for each entry?
OR
can I get the dir listing with in the CL based on wild card and use the output in a loop to build a move command?
PS: if I can get the IFS dir list within RPGLE program and used that for processing it would also help streamline the process.
thanks
Comment