BookmarkSubscribeRSS Feed
Santt0sh
Lapis Lazuli | Level 10

Hi All,

 

I need to read .log files from two different locations, or folders and create a single data to process the events listed in the .log file to a SAS data set

i am currently using the below code and i am not sure how to loop this and read the files into a SAS data set.

 

%let pth = /workspace/xxxx/xxxx/sasdta/ABC/logs/t1; /*one of the locations where the files are stored */

filename flx pipe "ls &path";

data x1;

length name $255.;

infile pth;

input name $;

lst_wrd = input(scan(name,-1,'.'),yymmdd10.);

fpth = "&pth./"||name;

if lst_wrd = '.' or lst_wrd ge "stdte."d then

output;

run;

 

/*to get the relevant files*/

 

data _null_;

 set x1;

call execute ("filename lrecds pipe 'more"||pth||" | grep com.sas.solutions.casemgmnt.util.AppSessionContext';

data x2;

length fnme $1000;

infile lrecds lrecl = 1000 dlm = '7F'x missover truncover dsd;

input fnme $;

if find (fnme,'INFO') then output;

run;

proc append base = x3 data = x2;

run;");

Run;

 

Please suggest me on this .

 

Thanks...

 

 

 

 

 

 

 

1 REPLY 1
Santt0sh
Lapis Lazuli | Level 10

Sorry i missed to mention, i also need to read files from another location, 

Location 2 :

 

%let pth1 = /workspace/xxxx/xxxx/sasdta/ABC/logs/t2; /*one of the locations where the files are stored */

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 813 views
  • 0 likes
  • 1 in conversation