Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

uploading from application server.

Former Member
0 Likes
305

Hi Experts,

I have a directory in the application server having many files which I need to be uploaded into an staging table.

I have written a program in this regard.

Now whenever a file from the directory is uploaded into the staging table ,we need to have an entry into another table called control table where the filename is entered ,the no.of rows in the file is entered and the date and time when the file is being staged to the table is entered.

How do I achieve this.

<REMOVED BY MODERATOR>

Regards ankit

Edited by: Alvaro Tejada Galindo on Jun 23, 2008 10:41 AM

1 REPLY 1
Read only

Former Member
0 Likes
284

Try this:

data:FILE_LIST like RSFILLST occurs 0 with header line.

data: begin of tabl occurs 500,

line(400),

end of tabl.

CLEAR file_list[].

clear tabl[].

concatenate 'dir' dirname into unixcom separated by space.

concatenate unixcom '\*.*' into unixcom.

call 'SYSTEM' id 'COMMAND' field unixcom

id 'TAB' field tabl[].

delete tabl where line cs 'Volume'.

delete tabl where line cs 'Directory'.

delete tabl where line cs 'Dir'.

delete tabl where line cs 'file'.

delete tabl where line = space.

loop at tabl.

clear tabl-line+0(39).

file_orig = tabl-line.

condense file_orig.

concatenate '"' file_orig '"' into file_orig.

condense tabl-line.

move tabl-line to file_list-name.

append file_list.

endloop.

*Don't consider '.' or '..'

delete file_list where NAME = '.' or name = '..'.

For unix change dir by ls