BookmarkSubscribeRSS Feed
u63406443
Calcite | Level 5

Hi All,

 

I am trying reading  the total of  10 SAS  program (.sas files) and storing entire 10  SAS program codes in the dataset using option filename statement, and finally filtering the words based some criteria and I am able to do that, i  getting output result as filter word,  but here problem is i need to get the full path name with whose filtered word condition is satisfied.

 

code:

filename rd

('C:\Users\rakes\Documents\My SAS Files\sas_practice\program_2.sas' ,

'C:\Users\rakes\Documents\My SAS Files\sas_practice\program_3.sas' ,

'C:\Users\rakes\Documents\My SAS Files\sas_practice\program_4.sas' ,

                like so on----

);

 

data temp;
infile rd truncover;
input rec $150.;

if index(lowcase(rec), "metafix") ne 0 then output;
run;

 

Result:

rec - column name

---

metafix

metafix is good

 

But i need as

Actual result

-------------

rec,fpath -- column names

 

metafix <filepath>

metafix is good <filepath>

 

 

 

Thanks,

Rakesh.

2 REPLIES 2

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 359 views
  • 1 like
  • 3 in conversation