<?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: how to create a loop logic? in Developers</title>
    <link>https://communities.sas.com/t5/Developers/how-to-create-a-loop-logic/m-p/921480#M6500</link>
    <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464675"&gt;@Shanthi123&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote this code for analyzing my crypto mining logs and it could be modified to do what you are asking with some changes... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="ClaymoreCryptoLogAnalysis.sas" href="https://github.com/trexpruitt/My_SAS_Code/blob/master/ClaymoreCryptoLogAnalysis.sas" target="_blank" rel="noopener"&gt;ClaymoreCryptoLogAnalysis.sas&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 11:46:31 GMT</pubDate>
    <dc:creator>reprui</dc:creator>
    <dc:date>2024-03-22T11:46:31Z</dc:date>
    <item>
      <title>how to create a loop logic?</title>
      <link>https://communities.sas.com/t5/Developers/how-to-create-a-loop-logic/m-p/921451#M6499</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can someone help me to create a loop logic .&lt;/P&gt;&lt;P&gt;my requirement: i want to search a list of table names in list of sas programs in a file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have 400 table names and i have 4000 sas programs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the code for for searching one single table in all the sas programs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%LET NAME = "MRC_ORDER_SCHEDULE_PK";															
															
*************************************************************************************************************************************;															
FILENAME INP "/sasdata/mpn_sas/programs/prd/oracle/tdmh2k/*.sas";															
															
DATA TDMH2K;															
     ;															
LENGTH _filepath FILEPATH1 $550;															
INFILE INP FILENAME = _filepath LRECL=80 PAD END = DONE ;															
DO WHILE(NOT DONE);															
     INPUT REC $CHAR80.;															
     filepath1 = STRIP(_filepath);															
    RECNO+1;															
     IF INDEX(UPCASE(REC),&amp;amp;NAME) THEN OUTPUT;															
END;															
RUN;															&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is the below code what i tried to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;FILENAME INP "/sasdata/mpn_sas/programs/prd/oracle/tdmh2k/*.sas";


%macro test(NAME);
DATA TDMH2K_TEMP;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;
LENGTH _filepath FILEPATH1 $550;
INFILE INP FILENAME = _filepath LRECL=80 PAD END = DONE ;
DO WHILE(NOT DONE);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT REC $CHAR80.;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filepath1 = STRIP(_filepath);
&amp;nbsp;&amp;nbsp;&amp;nbsp; RECNO+1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF INDEX(UPCASE(REC),&amp;amp;NAME) THEN OUTPUT;

END;
RUN;
PROC APPEND BASE=TDMH2K DATA=TDMH2K_TEMP FORCE;
RUN;
%mend;
DATA _NULL_;
SET TEST ;
DO i=1 TO 5;
IF s_no=i then do;
CALL SYMPUTX('NAME',trim(table_name));
end;
end;
%TEST(&amp;amp;NAME);
run;



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Can someone help .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the attached&amp;nbsp; output am getting. but i need the output with records. for one single table am able to get the output but when i try using loop .0 records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 07:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/how-to-create-a-loop-logic/m-p/921451#M6499</guid>
      <dc:creator>Shanthi123</dc:creator>
      <dc:date>2024-03-22T07:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a loop logic?</title>
      <link>https://communities.sas.com/t5/Developers/how-to-create-a-loop-logic/m-p/921480#M6500</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464675"&gt;@Shanthi123&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote this code for analyzing my crypto mining logs and it could be modified to do what you are asking with some changes... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="ClaymoreCryptoLogAnalysis.sas" href="https://github.com/trexpruitt/My_SAS_Code/blob/master/ClaymoreCryptoLogAnalysis.sas" target="_blank" rel="noopener"&gt;ClaymoreCryptoLogAnalysis.sas&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 11:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/how-to-create-a-loop-logic/m-p/921480#M6500</guid>
      <dc:creator>reprui</dc:creator>
      <dc:date>2024-03-22T11:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a loop logic?</title>
      <link>https://communities.sas.com/t5/Developers/how-to-create-a-loop-logic/m-p/921496#M6501</link>
      <description>Thanks for sharing.&lt;BR /&gt;Solution :&lt;BR /&gt;I got the logic by using call execute (%nrstr(%test("|| strip(name)||").&lt;BR /&gt;It worked.</description>
      <pubDate>Fri, 22 Mar 2024 12:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/how-to-create-a-loop-logic/m-p/921496#M6501</guid>
      <dc:creator>Shanthi123</dc:creator>
      <dc:date>2024-03-22T12:37:01Z</dc:date>
    </item>
  </channel>
</rss>

