/*If i have to pull out strings like below from a complete log file - do we have any method to do it?
NOTE: The data set work.test has 100 observations and 10 variables.
NOTE: The data set market.test2 has 500 observation and 50 variables.
*/
/*just a thought*/
filename logfile 'c:\test.log';
%let a=work | market;
%let b=any character;
%let c=any number;
%macro check;
if string in : ("NOTE: The data set &a.&b &c &b &c &b") then
do;
data test;
length string $100;
infile logfile;
string="NOTE: The data set &a.&b &c &b &c &b";
run;
proc sql;
select loginfo into :string separated by ' ' from test;
quit;
end;
%mend;
%check;
/*thanks*/
Hi:
I'm not sure you have the macro code correct. Your macro variables are not doing what you think they are going to do. Try this test:
%let a=work | market;
%let b=any character;
%let c=any number;
%macro check;
%put NOTE: The data set &a.&b &c &b &c &b;
%mend;
%check;
and then look in the SAS log (see screen shot). Have you tried to actually RUN your code???? Your IF statement is incorrect.
cynthia
Cynthia - i mentioned in my comment that this is just thought - I am not expert at all on macro, i am at very beginning stage in macro as well as SAS. I just wanted to know if somehow we can pull those particular strings
(
NOTE: The data set work.test has 100 observations and 10 variables.
NOTE: The data set market.test2 has 500 observation and 50 variables.
)
from log.
- Thanks for your time!!!
If the goal is to create a summary of "net data sets created/modified" by the current program, then perhaps you could instrument your program for this. Here's an approach that uses the data table datetime stamp to detect which tables were modified after a given point in time (captured at the program start):
Make sense?
Chris
WOW Chris ... ... this is awesome...This will definitely help. I didn't think someone would come up with just 2 steps to fulfill this requirement.
Thanks a lot...!!! i really appreciate your time...!!!
I will drop unwanted variables from "net_tables"...
- Thanks Again Chris.
- Thanks ALL for your time and comments.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.