<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Searching a specific value in many dataset then putting some info into another dataset in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920186#M44467</link>
    <description>&lt;PRE&gt;&lt;CODE class=""&gt;%let monthlist=aou avr dec fev jan jul jun mai mar nov oct sep;
%let yearlist=2006 2007 2008 2009 2010;
%let subfolder=auto habi entr;
%let loblist=auto prop cna;
%let cielist=nx;
%macro test;
Data temp;
length filename $25. libname $100. policyfound $20.;
run;
%do h=1 %to %sysfunc(countw(&amp;amp;cielist.));
	%do i=1 %to %sysfunc(countw(&amp;amp;loblist.))-1;
		%do k=1 %to %sysfunc(countw(&amp;amp;yearlist.));
			%do j=1 %to %sysfunc(countw(&amp;amp;monthlist.));
				%let fname=%scan(&amp;amp;cielist.,&amp;amp;h)_%scan(&amp;amp;loblist.,&amp;amp;i)_prm%scan(&amp;amp;monthlist.,&amp;amp;j)%scan(&amp;amp;yearlist.,&amp;amp;k);
				%let libnm=/dwh_actuariat/sasdata/sas%scan(&amp;amp;yearlist.,&amp;amp;k)/%scan(&amp;amp;cielist.,&amp;amp;h)/%scan(&amp;amp;subfolder.,&amp;amp;i)/;
				%put &amp;amp;=libnm &amp;amp;=fname.;
				libname src1 spde "&amp;amp;libnm.";
				data check;
					length path dataset agreement_nbr $1000;
                	set src1.&amp;amp;fname;
					%let agreement_nbr=PPPPP0447187;
					if agreement_nbr eq "&amp;amp;agreement_nbr." then    
					do;
						path = "&amp;amp;libnm/&amp;amp;fname.";
						dataset = "&amp;amp;fname";&lt;BR /&gt;                                                output;
						stop;
					end;
					keep path dataset agreement_nbr;
				run; 
				proc append base=want data=check nowarn;
				run;
			%end;
		%end;
	%end;
%end;

%mend test;



data want;
	length path dataset agreement_nbr $1000;
	stop;
	call missing(of _all_);
run;
%test;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've adjusted your solution to show what i am thinking. This is untested though, but I believe it will work.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 19:36:49 GMT</pubDate>
    <dc:creator>Mazi</dc:creator>
    <dc:date>2024-03-13T19:36:49Z</dc:date>
    <item>
      <title>Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920164#M44463</link>
      <description>&lt;P&gt;Imagine that I have many datasets like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dataset1&lt;/P&gt;
&lt;P&gt;dataset2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;dataset1000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I have an agreement_nbr like&amp;nbsp;PPPPP0447187&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I have created a macro function to seach this value in many dataset, except that I am sendig the agreement_nbr, the path and filename into the log file.&lt;/P&gt;
&lt;P&gt;How can we send this information into Data want, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Imagine that I have many agreement_nbr to search for and some basic information surch as path, agreement_nbr and filename into data want.&amp;nbsp; How do we do that.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let monthlist=aou avr dec fev jan jul jun mai mar nov oct sep;
%let yearlist=2006 2007 2008 2009 2010;
%let subfolder=auto habi entr;
%let loblist=auto prop cna;
%let cielist=nx;
%macro test;
Data temp;
length filename $25. libname $100. policyfound $20.;
run;
%do h=1 %to %sysfunc(countw(&amp;amp;cielist.));
	%do i=1 %to %sysfunc(countw(&amp;amp;loblist.))-1;
		%do k=1 %to %sysfunc(countw(&amp;amp;yearlist.));
			%do j=1 %to %sysfunc(countw(&amp;amp;monthlist.));
				%let fname=%scan(&amp;amp;cielist.,&amp;amp;h)_%scan(&amp;amp;loblist.,&amp;amp;i)_prm%scan(&amp;amp;monthlist.,&amp;amp;j)%scan(&amp;amp;yearlist.,&amp;amp;k);
				%let libnm=/dwh_actuariat/sasdata/sas%scan(&amp;amp;yearlist.,&amp;amp;k)/%scan(&amp;amp;cielist.,&amp;amp;h)/%scan(&amp;amp;subfolder.,&amp;amp;i)/;
				%put &amp;amp;=libnm &amp;amp;=fname.;
				libname src1 spde "&amp;amp;libnm.";
				data _null_;
                	set src1.&amp;amp;fname;
					%let agreement_nbr=PPPPP0447187;
					if agreement_nbr eq "&amp;amp;agreement_nbr." then    
					do;
						put "the policy &amp;amp;agreement_nbr exist in &amp;amp;libnm/&amp;amp;fname.";
					end;
				run; 
			%end;
		%end;
	%end;
%end;


%mend test;
%test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 18:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920164#M44463</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-03-13T18:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920173#M44464</link>
      <description>&lt;P&gt;If I understand you correctly,&lt;BR /&gt;&lt;BR /&gt;You can create a dataset called “want” with the expected columns and 0 rows.&lt;BR /&gt;&lt;BR /&gt;Then instead of using the put to route output to the log, output to a temporary dataset, and finally use proc append to keep adding rows to your want data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data want;
	length message $1000;
	stop;
	call missing(message);
run;

%macro test;

		%do i=1 %to 100;
			data have;
				length message $1000;
				message="Dataset &amp;amp;i";
			run;

			proc append base=want data=have nowarn;
			run;
		%end;

%mend;

%test&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 19:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920173#M44464</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-13T19:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920179#M44465</link>
      <description>&lt;P&gt;Imagine that I am looking for this value =PPPP0447187&amp;nbsp; in the variable Agreement_Nbr into 100 datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When found into a specific data set, I want to put into dataset want the following information:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;agreement_nbr&lt;/P&gt;
&lt;P&gt;path&lt;/P&gt;
&lt;P&gt;dataset name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;who do we do that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 19:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920179#M44465</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-03-13T19:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920182#M44466</link>
      <description>&lt;P&gt;Do you need to identify which specific agreement number is in the file or just that an agreement is found?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If just that an agreement in the list is found, then SQL is a better option. If you need to find the specific agreement, then a data step approach with a a temporary array is a better approach.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/2f733d27820f43fa37d6ba92c30f22cf" target="_blank"&gt;https://gist.github.com/statgeek/2f733d27820f43fa37d6ba92c30f22cf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Imagine that I have many datasets like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dataset1&lt;/P&gt;
&lt;P&gt;dataset2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;dataset1000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I have an agreement_nbr like&amp;nbsp;PPPPP0447187&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I have created a macro function to seach this value in many dataset, except that I am sendig the agreement_nbr, the path and filename into the log file.&lt;/P&gt;
&lt;P&gt;How can we send this information into Data want, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Imagine that I have many agreement_nbr to search for and some basic information surch as path, agreement_nbr and filename into data want.&amp;nbsp; How do we do that.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let monthlist=aou avr dec fev jan jul jun mai mar nov oct sep;
%let yearlist=2006 2007 2008 2009 2010;
%let subfolder=auto habi entr;
%let loblist=auto prop cna;
%let cielist=nx;
%macro test;
Data temp;
length filename $25. libname $100. policyfound $20.;
run;
%do h=1 %to %sysfunc(countw(&amp;amp;cielist.));
	%do i=1 %to %sysfunc(countw(&amp;amp;loblist.))-1;
		%do k=1 %to %sysfunc(countw(&amp;amp;yearlist.));
			%do j=1 %to %sysfunc(countw(&amp;amp;monthlist.));
				%let fname=%scan(&amp;amp;cielist.,&amp;amp;h)_%scan(&amp;amp;loblist.,&amp;amp;i)_prm%scan(&amp;amp;monthlist.,&amp;amp;j)%scan(&amp;amp;yearlist.,&amp;amp;k);
				%let libnm=/dwh_actuariat/sasdata/sas%scan(&amp;amp;yearlist.,&amp;amp;k)/%scan(&amp;amp;cielist.,&amp;amp;h)/%scan(&amp;amp;subfolder.,&amp;amp;i)/;
				%put &amp;amp;=libnm &amp;amp;=fname.;
				libname src1 spde "&amp;amp;libnm.";
				data _null_;
                	set src1.&amp;amp;fname;
					%let agreement_nbr=PPPPP0447187;
					if agreement_nbr eq "&amp;amp;agreement_nbr." then    
					do;
						put "the policy &amp;amp;agreement_nbr exist in &amp;amp;libnm/&amp;amp;fname.";
					end;
				run; 
			%end;
		%end;
	%end;
%end;


%mend test;
%test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 19:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920182#M44466</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-03-13T19:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920186#M44467</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;%let monthlist=aou avr dec fev jan jul jun mai mar nov oct sep;
%let yearlist=2006 2007 2008 2009 2010;
%let subfolder=auto habi entr;
%let loblist=auto prop cna;
%let cielist=nx;
%macro test;
Data temp;
length filename $25. libname $100. policyfound $20.;
run;
%do h=1 %to %sysfunc(countw(&amp;amp;cielist.));
	%do i=1 %to %sysfunc(countw(&amp;amp;loblist.))-1;
		%do k=1 %to %sysfunc(countw(&amp;amp;yearlist.));
			%do j=1 %to %sysfunc(countw(&amp;amp;monthlist.));
				%let fname=%scan(&amp;amp;cielist.,&amp;amp;h)_%scan(&amp;amp;loblist.,&amp;amp;i)_prm%scan(&amp;amp;monthlist.,&amp;amp;j)%scan(&amp;amp;yearlist.,&amp;amp;k);
				%let libnm=/dwh_actuariat/sasdata/sas%scan(&amp;amp;yearlist.,&amp;amp;k)/%scan(&amp;amp;cielist.,&amp;amp;h)/%scan(&amp;amp;subfolder.,&amp;amp;i)/;
				%put &amp;amp;=libnm &amp;amp;=fname.;
				libname src1 spde "&amp;amp;libnm.";
				data check;
					length path dataset agreement_nbr $1000;
                	set src1.&amp;amp;fname;
					%let agreement_nbr=PPPPP0447187;
					if agreement_nbr eq "&amp;amp;agreement_nbr." then    
					do;
						path = "&amp;amp;libnm/&amp;amp;fname.";
						dataset = "&amp;amp;fname";&lt;BR /&gt;                                                output;
						stop;
					end;
					keep path dataset agreement_nbr;
				run; 
				proc append base=want data=check nowarn;
				run;
			%end;
		%end;
	%end;
%end;

%mend test;



data want;
	length path dataset agreement_nbr $1000;
	stop;
	call missing(of _all_);
run;
%test;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've adjusted your solution to show what i am thinking. This is untested though, but I believe it will work.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 19:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920186#M44467</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-13T19:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920187#M44468</link>
      <description>&lt;P&gt;For example,&lt;/P&gt;
&lt;P&gt;if the agreement_nbr&amp;nbsp;PPPP0447187 is found in dataset data1, data10, data28, data51 then&lt;/P&gt;
&lt;P&gt;I would like to see in table want this information&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;agreement_nbr&amp;nbsp; filename libname&lt;/P&gt;
&lt;P&gt;PPPP0447187&amp;nbsp;&amp;nbsp;data1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lib1&lt;/P&gt;
&lt;P&gt;PPPP0447187&amp;nbsp;&amp;nbsp;data10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lib10&lt;/P&gt;
&lt;P&gt;PPPP0447187&amp;nbsp;&amp;nbsp;data28&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lib50&lt;/P&gt;
&lt;P&gt;PPPP0447187&amp;nbsp;&amp;nbsp;data51&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lib100&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 19:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920187#M44468</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-03-13T19:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920206#M44469</link>
      <description>&lt;P&gt;Ok, assume you have a table with the agreement number with the same variable name and it is called LOOKUP.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Untested as no data but this approach should work, rough code below:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use a SQL query with a WHERE statement to select from the lookup table, use Distinct to keep only one record of each agreement incase of duplicates.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Use the automatic macro variable SQLOBS to determine if any records were selected&lt;/LI&gt;
&lt;LI&gt;If records are selected, append to master table.&lt;/LI&gt;
&lt;LI&gt;Delete temporary table from step 1 and repeat.&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let monthlist=aou avr dec fev jan jul jun mai mar nov oct sep;
%let yearlist=2006 2007 2008 2009 2010;
%let subfolder=auto habi entr;
%let loblist=auto prop cna;
%let cielist=nx;
%macro test;
Data temp;
length filename $25. libname $100. policyfound $20.;
run;
%do h=1 %to %sysfunc(countw(&amp;amp;cielist.));
	%do i=1 %to %sysfunc(countw(&amp;amp;loblist.))-1;
		%do k=1 %to %sysfunc(countw(&amp;amp;yearlist.));
			%do j=1 %to %sysfunc(countw(&amp;amp;monthlist.));
				%let fname=%scan(&amp;amp;cielist.,&amp;amp;h)_%scan(&amp;amp;loblist.,&amp;amp;i)_prm%scan(&amp;amp;monthlist.,&amp;amp;j)%scan(&amp;amp;yearlist.,&amp;amp;k);
				%let libnm=/dwh_actuariat/sasdata/sas%scan(&amp;amp;yearlist.,&amp;amp;k)/%scan(&amp;amp;cielist.,&amp;amp;h)/%scan(&amp;amp;subfolder.,&amp;amp;i)/;
				%put &amp;amp;=libnm &amp;amp;=fname.;
				libname src1 spde "&amp;amp;libnm.";
				
                                proc sql;
                                create table table_info as
                                select distinct agreement_nbr, "&amp;amp;fname" as filename, "&amp;amp;libnm" as libname from &amp;amp;libnm..&amp;amp;fname. where agreement_nbr in (select agreement_nbr from lookup); quit;

                                   %if &amp;amp;sqlobs ne 0 %then %do;
                                   proc append base=found_agreements  data=table_info force;
run;
%end;

                                   proc sql; drop table table_info; quit;
                              
			%end;
		%end;
	%end;
%end;


%mend test;
%test;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 22:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920206#M44469</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-03-13T22:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Searching a specific value in many dataset then putting some info into another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920219#M44470</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lookup;
input agreement_nbr $15.;
datalines;
XXXXX47187
XXXXX447187
XXXX5642
;
run;

%let monthlist=aou avr dec fev jan jul jun mai mar nov oct sep;
%let yearlist=2006 2007 2008 2009 2010;
%let subfolder=auto habi entr;
%let loblist=auto prop cna;
%let cielist=nx;
%macro searchpolicies;
Data found_agreements;
length agreement_nbr $20. filename $25. libname $100. ;
run;

%do h=1 %to %sysfunc(countw(&amp;amp;cielist.));
	%do i=1 %to %sysfunc(countw(&amp;amp;loblist.))-1;
		%do k=1 %to %sysfunc(countw(&amp;amp;yearlist.));
			%do j=1 %to %sysfunc(countw(&amp;amp;monthlist.));
				%let fname=%scan(&amp;amp;cielist.,&amp;amp;h)_%scan(&amp;amp;loblist.,&amp;amp;i)_prm%scan(&amp;amp;monthlist.,&amp;amp;j)%scan(&amp;amp;yearlist.,&amp;amp;k);
				%let libnm=/dwh_actuariat/sasdata/sas%scan(&amp;amp;yearlist.,&amp;amp;k)/%scan(&amp;amp;cielist.,&amp;amp;h)/%scan(&amp;amp;subfolder.,&amp;amp;i)/;
				%put &amp;amp;=libnm &amp;amp;=fname.;
				libname src1 spde "&amp;amp;libnm.";
				%put &amp;amp;libnm.&amp;amp;fname.;
				proc sql;
                create table table_info as
                select distinct agreement_nbr as agreement_nbr length=20, 
                         "&amp;amp;fname" as filename length=25, 
                         "&amp;amp;libnm" as libname length=100
                from src1.&amp;amp;fname. 
				where agreement_nbr in (select agreement_nbr from lookup); 
                quit;
				%if &amp;amp;sqlobs ne 0 %then 
				%do;
                	proc append base=found_agreements data=table_info force;
					run;
				%end;
				proc sql; 
				drop table table_info; 
				quit;                              
			%end;
		%end;
	%end;
%end;
proc sort data=found_agreements;
by libname filename agreement_nbr;
run;
%mend searchpolicies;
%searchpolicies;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 23:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Searching-a-specific-value-in-many-dataset-then-putting-some/m-p/920219#M44470</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-03-13T23:34:21Z</dc:date>
    </item>
  </channel>
</rss>

