Multiple files to load into different tables

multiple files to load into different tables,

I have a script show below, but this script loads data from txt file into a table,
but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder ,
can we load these files in diff tables (table 1, table2 .............) in load.
or
can we load this files in the same table with the file name as another column

-----------------script-----------------

Code:

proc printto log="/test/userabc/xyz.log" new; run;

data temp;
%let _EFIERR_ = 0; 
filename bobj ('/test/xyzload.txt');

infile rma
delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=1 ; 

informat col1 $18.;
informat col2 $20.;
informat col3 $20.;
informat col4 $5.;
informat col5 $5.;
informat col6 $5.;
informat col7 $20.;
informat id $12.;

input
col1 $
col2 $
col3 $
col4 $
col5 $
col6 $
col7 $
id $
;

format col1 $18.;
format col2 $20.;
format col3 $20.;
format col4 $5.;
format col5 $5.;
format col6 $5.;
format col7 $20.;
id=_n_;

if _ERROR_ then call symput('_EFIERR_',1);
run;

data lbe_temp;
set temp;
keep
col1
col2
col3
col4
col5
col6
col7
id
;
run;


libname xxxx  user=&uid. pass=&pwd. database="jump" server=jumpper1;
run;

data td.table1(tenacity = 5 sleep = 1 dbcreate_table_opts='PRIMARY INDEX(id,col1)' dbcommit=1000000 fastload=yes);
set lbe_temp;
run;

proc sql _method feedback;
proc printto; run;

nani1984,
This looks more like a SAS question than a Unix question. I'm sure if you post in SAS forum you will get a better response but I will give some suggestions based on my older experience with SAS.

  1. Looks like the sole purpose of the below datastep is to keep only select variables. Instead of reading the entire data set again
    and creating another data step, why not just put KEEP= on the data temp when you are creating that data set?
data lbe_temp;
set temp;
keep
col1
col2
col3
col4
col5
col6
col7
id
;
run;
data temp (KEEP=col1, col2, col3, col4, col5, col6, col7, id);
  1. To read in multiple files, you can use pipe statement.
filename myfile pipe �ls -1� xyz*load.txt

Once you read in files, you can then loop thru them and load the file names, usually with a macro, into you tables as you require.
See below links:

http://www.wuss.org/proceedings12/55.pdf
https://support.sas.com/techsup/technote/ts581.pdf