09-14-2015 09:46 AM
My requirement is to read the .txt file which has filenames as follows. Now I need to read all these files to produce a master datset. All these files has a same layout.
I was trying to read all these filas as below code,but this code is not working as I excepted.Because only 1 record from each infile read instead of reading all the records.
I'm not sure for this strange behaviour.Please guide me.
DATA output_data_set; /* read the file references in variable called file_names */ INFILE '/temp/test/inputfile_txt' dsd truncover FILEVAR = file_names END = end_of_file LRECL=32000; DO WHILE (end_of_file = 0); input var : $ 3000.; /*filename=file_names;*/ var1 = _infile_; if var1 = :'201'; Date_TimeStamp= scan(var1,1," "); Status = scan(var1,2," "); Processid = scan(var1,3," "); userid = scan(var1,4," "); Details = scan(var1,-1,'-'); drop var var1; OUTPUT; END; RUN;
09-14-2015 09:56 AM
This seems to very simliar to this question:
I have responded there (however am struggling to use the new forum, and can't see that response).