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.
Use the FILENAME= option of the INFILE Statement to retrieve the name of the file which is currently read.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.