<?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: SAS Macro - number of records to go further in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405482#M279173</link>
    <description>&lt;P&gt;It also has something to do withe the way Call execute Works.. I think.&lt;/P&gt;&lt;P&gt;I do not see why now... But this Works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; %macro Test(source);&lt;BR /&gt;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp; if _n_ = 1 then call symputx('obscnt',0);&lt;BR /&gt;&amp;nbsp; set SAP_prd."&amp;amp;source"n end=lastobs;&lt;BR /&gt;&amp;nbsp; if lastobs then Call symputx('obscnt', _N_);&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp; %put &amp;amp;source=&amp;amp;obscnt;&lt;BR /&gt;&amp;nbsp; %if &amp;amp;obscnt &amp;gt; 0 %then %do;&lt;BR /&gt;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp; %mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data all_columns&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; dataset =&amp;nbsp;&amp;nbsp;&amp;nbsp; '/BI0/TPROFIT_CTR'&amp;nbsp;&amp;nbsp;&amp;nbsp; ; output;&lt;BR /&gt;&amp;nbsp; dataset =&amp;nbsp;&amp;nbsp;&amp;nbsp; '/BI0/TMATERIAL'&amp;nbsp;&amp;nbsp; ; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Filename test temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; file test;&lt;BR /&gt;&amp;nbsp; set all_columns;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Kode = '%Test(source='||strip(dataset)||')';&lt;BR /&gt;&amp;nbsp;put kode;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;%INC test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try it !&lt;/P&gt;&lt;P&gt;(note that I changed the libname to make it fit in my Place)&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2017 11:58:58 GMT</pubDate>
    <dc:creator>PSNn</dc:creator>
    <dc:date>2017-10-19T11:58:58Z</dc:date>
    <item>
      <title>SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405444#M279162</link>
      <description>&lt;P&gt;I want to loop through a list of datasets, check if they have more then one record, if so, i want to do something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My macro variable&amp;nbsp;&lt;SPAN&gt;obscnt&lt;/SPAN&gt; does not work.. any help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro Test(source);&lt;BR /&gt;data _null_;&lt;BR /&gt;call symput('obscnt',0);&lt;BR /&gt;set SAP_SRC."&amp;amp;source"n end=lastobs;&lt;BR /&gt;if lastobs then do;&lt;BR /&gt;call symput('obscnt',_n_);&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;source=&amp;amp;obscnt;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;obscnt &amp;gt; 0 %then %do;&lt;/P&gt;
&lt;P&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt; set all_columns; &lt;BR /&gt; call execute('%Test(source='||strip(dataset)||')');&lt;BR /&gt; run;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 09:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405444#M279162</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2017-10-19T09:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405446#M279163</link>
      <description>&lt;P&gt;Its really not clear from your post what you are trying to do.&amp;nbsp; The macro seems to call itself if something occurs.&amp;nbsp; Please post example test data in the form of a datastep and show what the output should be.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simply query the sashelp metadata and use those to trigger macro calls with something like:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vtable (where=(libname="YOURLIB" and nobs &amp;gt; 0));
  if _n_=1 then call execute('%...');
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Oct 2017 09:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405446#M279163</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-19T09:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405447#M279164</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;In my table all_columns i have a list of columns, which exists as a table in SAP.&lt;BR /&gt;&lt;BR /&gt;For every column, i call my macro Test. Here i want to check if the table in SAP has records.&lt;BR /&gt;&lt;BR /&gt;If so, i want to create a format. &lt;BR /&gt;&lt;BR /&gt;The only part i'm struggling with, is the part where i have to check if the table in SAP has records.</description>
      <pubDate>Thu, 19 Oct 2017 09:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405447#M279164</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2017-10-19T09:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405453#M279165</link>
      <description>&lt;P&gt;What is SAP?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a libname to it then there will be metadata in sashelp.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want a format created why not proc freq all variables in each dataset, then use that as the basis for your format?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 09:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405453#M279165</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-19T09:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405455#M279166</link>
      <description>&lt;P&gt;Please note:&lt;/P&gt;
&lt;P&gt;1) In oreder to use LASTOBS as you used, you need to define it first:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let obscnt = 0;
data _null_; 
   set  &amp;lt;your input&amp;gt; end=lastobs;
   if lastobs then call symput('obscnt',strip(_N_));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2) Alternatively you can do - without reading your input &lt;STRONG&gt;sas&lt;/STRONG&gt; dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    id = open("&amp;lt;your input&amp;gt;");
    if id then do;
        nobs = attrn(id, 'nobs');
        call symput('obscnt', strip(nobs));
        id=close(id);
    end;
    else call symput('obscnt','0');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Oct 2017 09:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405455#M279166</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-10-19T09:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405468#M279167</link>
      <description>&lt;P&gt;Be carefull... For SAP tables SAS do not know anything about number of records.&amp;nbsp; Stay comlpletely away from things like SASHELP.TABLES... I assume you know how many tables a SAP installation have (?)&amp;nbsp; Calling&amp;nbsp; SASHELP.TABLES may run for a very long time without giving you "anything". I think you are on your way to the best solution.&amp;nbsp;&amp;nbsp; I do not immediately see what is wrong With Your code, but if you mean whart you say:. do not read to the end of the tables to figure out if it's time to do something.&amp;nbsp; More like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if _n_ = 2 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call symputx('obscnt', '2');&lt;/P&gt;&lt;P&gt;&amp;nbsp; STOP;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will save a lot of time..&amp;nbsp; As I understand you are not interested in the number of rows, You just what to know that there is at least 2 rows.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 10:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405468#M279167</guid>
      <dc:creator>PSNn</dc:creator>
      <dc:date>2017-10-19T10:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405471#M279168</link>
      <description>&lt;P&gt;Ok.... Use this for setting the macro var to 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if _n_ = 1 then&amp;nbsp;&lt;/STRONG&gt; call symput('obscnt',0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS WILL execute this one again&amp;nbsp; before terminating the step, hence resetting it to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But still, do not read all the records in the SAP table just to figure at that there are "some" records...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 10:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405471#M279168</guid>
      <dc:creator>PSNn</dc:creator>
      <dc:date>2017-10-19T10:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405475#M279169</link>
      <description>&lt;P&gt;Already big thanks for your replies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know I can stop after 2 records, but now for testing i changed it to the last row.&lt;/P&gt;
&lt;P&gt;Indeed, SASHELP tables in combination with SAP is impossible. Also, i don't want to create formats of every SAP table. Only those I want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro Test(source);&lt;BR /&gt;data _null_;&lt;BR /&gt;set SAP_SRC."&amp;amp;source"n end=lastobs;&lt;BR /&gt;if _n_ = 1 then call symputx('obscnt',0);&lt;BR /&gt;if lastobs then Call symputx('obscnt', _N_);&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;source=&amp;amp;obscnt;&lt;BR /&gt;%if &amp;amp;obscnt &amp;gt; 0 %then %do;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt; set all_columns; &lt;BR /&gt; call execute('%Test(source='||strip(dataset)||')');&lt;BR /&gt; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the output in my log: as you can see...&amp;nbsp;it's always 50, but is because my last table has 50 records.. all the rest have more&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&amp;nbsp;NOTE: There were 1292 observations read from the data set SAP_SRC.'/BIC/TZMAGBEST'n.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So.. something is not working correctly with the macro variable i think?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/BIC/TVAUFNR=50&lt;BR /&gt;/BIC/TZBEHVRSC=50&lt;BR /&gt;/BIC/TZBELEVFEQ=50&lt;BR /&gt;/BIC/TZFINTYPE=50&lt;BR /&gt;/BIC/TZMAGBEST=50&lt;BR /&gt;/BIC/TZMATPLANT=50&lt;BR /&gt;/BIC/TZMATPROF=50&lt;BR /&gt;/BIC/TZMKPFUSN=50&lt;BR /&gt;/BIC/TZMSATTYP=50&lt;BR /&gt;/BIC/TZMSBUKRS=50&lt;BR /&gt;/BIC/TZMSBUWD=50&lt;BR /&gt;/BIC/TZMSBWART=50&lt;BR /&gt;/BIC/TZMSBWKEY=50&lt;BR /&gt;/BIC/TZMSBWTAR=50&lt;BR /&gt;/BIC/TZMSDEFSH=50&lt;BR /&gt;2 The SAS System 12:49 Thursday, October 19, 2017&lt;/P&gt;
&lt;P&gt;/BIC/TZMSGRUNDS=50&lt;BR /&gt;/BIC/TZMSGSBER=50&lt;BR /&gt;/BIC/TZMSKOKRS=50&lt;BR /&gt;/BIC/TZMSKOSTL=50&lt;BR /&gt;/BIC/TZMSKSTRG=50&lt;BR /&gt;/BIC/TZMSKUNNR=50&lt;BR /&gt;/BIC/TZMSKZEAR=50&lt;BR /&gt;/BIC/TZMSLGORT=50&lt;BR /&gt;/BIC/TZMSLIFNR=50&lt;BR /&gt;/BIC/TZMSMATNR=50&lt;BR /&gt;/BIC/TZMSPRCTR=50&lt;BR /&gt;/BIC/TZMSRWEMPF=50&lt;BR /&gt;/BIC/TZMSSAKTO=50&lt;BR /&gt;/BIC/TZMSSHKZG=50&lt;BR /&gt;/BIC/TZMSUMWRK=50&lt;BR /&gt;/BIC/TZMSWERKS=50&lt;BR /&gt;/BIC/TZMSZBWAR=50&lt;BR /&gt;/BIC/TZONWW=50&lt;BR /&gt;/BIC/TZSTPLOPHP=50&lt;BR /&gt;/BIC/TZUIDMATPO=50&lt;BR /&gt;/BIC/TZVSTBEST=50&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 11:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405475#M279169</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2017-10-19T11:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405476#M279170</link>
      <description>&lt;P&gt;You need to have the&amp;nbsp;&amp;nbsp;&amp;nbsp; IF _N:_ = 1 ,,,&lt;/P&gt;&lt;P&gt;BEFORE the SET stmt !&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (important)&amp;nbsp; .. as you did have in the original post&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or you&amp;nbsp; could of course have a&lt;/P&gt;&lt;P&gt;%LET obscnt&amp;nbsp; = 0 ;&lt;/P&gt;&lt;P&gt;before the datastep.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 11:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405476#M279170</guid>
      <dc:creator>PSNn</dc:creator>
      <dc:date>2017-10-19T11:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405477#M279171</link>
      <description>&lt;P&gt;As you have set it up, it will not handle tables With 0 rows.&lt;/P&gt;&lt;P&gt;Moving the statement as indicated will fix that&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 11:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405477#M279171</guid>
      <dc:creator>PSNn</dc:creator>
      <dc:date>2017-10-19T11:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405481#M279172</link>
      <description>&lt;P&gt;If i change it like this, i reset it every time to zero: i also putted a put statement if my obscount is bigger then 0.&lt;/P&gt;
&lt;P&gt;But still my macrovariable does not has the right value i think... or not at runtime&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;%macro Test(source);&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('obscnt',0);&lt;BR /&gt;set SAP_SRC."&amp;amp;source"n end=lastobs;&lt;BR /&gt;if lastobs then Call symputx('obscnt', _N_);&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;source=&amp;amp;obscnt;&lt;BR /&gt;%if &amp;amp;obscnt &amp;gt; 0 %then %do;&lt;BR /&gt;%put &amp;amp;source;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt; set all_columns; &lt;BR /&gt; call execute('%Test(source='||strip(dataset)||')');&lt;BR /&gt; /*if dataset = "/BIC/TVAUFNR" then call execute('%CreateFormat(source='||strip(dataset)||',formatname=F_'||strip(column)||',type='||strip(type)||');');&lt;BR /&gt;*/&lt;BR /&gt; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;'/BIC/TZMSZBWAR'n. is a dataset with zero records... but my macovariable says 50&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I think it says 50 because my last table has 50 records... :&amp;nbsp;SAP_SRC.'/BIC/TZVSTBEST'n.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Log:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE: There were 0 observations read from the data set SAP_SRC.'/BIC/TZMSZBWAR'n.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE: There were 50 observations read from the data set SAP_SRC.'/BIC/TZVSTBEST'n.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;/BIC/TVAUFNR=50&lt;BR /&gt;/BIC/TVAUFNR&lt;BR /&gt;/BIC/TZBEHVRSC=50&lt;BR /&gt;/BIC/TZBEHVRSC&lt;BR /&gt;/BIC/TZBELEVFEQ=50&lt;BR /&gt;/BIC/TZBELEVFEQ&lt;BR /&gt;/BIC/TZFINTYPE=50&lt;BR /&gt;/BIC/TZFINTYPE&lt;BR /&gt;/BIC/TZMAGBEST=50&lt;BR /&gt;/BIC/TZMAGBEST&lt;BR /&gt;/BIC/TZMATPLANT=50&lt;BR /&gt;/BIC/TZMATPLANT&lt;BR /&gt;/BIC/TZMATPROF=50&lt;BR /&gt;/BIC/TZMATPROF&lt;BR /&gt;2 The SAS System 12:49 Thursday, October 19, 2017&lt;/P&gt;
&lt;P&gt;/BIC/TZMKPFUSN=50&lt;BR /&gt;/BIC/TZMKPFUSN&lt;BR /&gt;/BIC/TZMSATTYP=50&lt;BR /&gt;/BIC/TZMSATTYP&lt;BR /&gt;/BIC/TZMSBUKRS=50&lt;BR /&gt;/BIC/TZMSBUKRS&lt;BR /&gt;/BIC/TZMSBUWD=50&lt;BR /&gt;/BIC/TZMSBUWD&lt;BR /&gt;/BIC/TZMSBWART=50&lt;BR /&gt;/BIC/TZMSBWART&lt;BR /&gt;/BIC/TZMSBWKEY=50&lt;BR /&gt;/BIC/TZMSBWKEY&lt;BR /&gt;/BIC/TZMSBWTAR=50&lt;BR /&gt;/BIC/TZMSBWTAR&lt;BR /&gt;/BIC/TZMSDEFSH=50&lt;BR /&gt;/BIC/TZMSDEFSH&lt;BR /&gt;/BIC/TZMSGRUNDS=50&lt;BR /&gt;/BIC/TZMSGRUNDS&lt;BR /&gt;/BIC/TZMSGSBER=50&lt;BR /&gt;/BIC/TZMSGSBER&lt;BR /&gt;/BIC/TZMSKOKRS=50&lt;BR /&gt;/BIC/TZMSKOKRS&lt;BR /&gt;/BIC/TZMSKOSTL=50&lt;BR /&gt;/BIC/TZMSKOSTL&lt;BR /&gt;/BIC/TZMSKSTRG=50&lt;BR /&gt;/BIC/TZMSKSTRG&lt;BR /&gt;/BIC/TZMSKUNNR=50&lt;BR /&gt;/BIC/TZMSKUNNR&lt;BR /&gt;/BIC/TZMSKZEAR=50&lt;BR /&gt;/BIC/TZMSKZEAR&lt;BR /&gt;/BIC/TZMSLGORT=50&lt;BR /&gt;/BIC/TZMSLGORT&lt;BR /&gt;/BIC/TZMSLIFNR=50&lt;BR /&gt;/BIC/TZMSLIFNR&lt;BR /&gt;/BIC/TZMSMATNR=50&lt;BR /&gt;/BIC/TZMSMATNR&lt;BR /&gt;/BIC/TZMSPRCTR=50&lt;BR /&gt;/BIC/TZMSPRCTR&lt;BR /&gt;/BIC/TZMSRWEMPF=50&lt;BR /&gt;/BIC/TZMSRWEMPF&lt;BR /&gt;/BIC/TZMSSAKTO=50&lt;BR /&gt;/BIC/TZMSSAKTO&lt;BR /&gt;/BIC/TZMSSHKZG=50&lt;BR /&gt;/BIC/TZMSSHKZG&lt;BR /&gt;/BIC/TZMSUMWRK=50&lt;BR /&gt;/BIC/TZMSUMWRK&lt;BR /&gt;/BIC/TZMSWERKS=50&lt;BR /&gt;/BIC/TZMSWERKS&lt;BR /&gt;/BIC/TZMSZBWAR=50&lt;BR /&gt;/BIC/TZMSZBWAR&lt;BR /&gt;/BIC/TZONWW=50&lt;BR /&gt;/BIC/TZONWW&lt;BR /&gt;/BIC/TZSTPLOPHP=50&lt;BR /&gt;/BIC/TZSTPLOPHP&lt;BR /&gt;/BIC/TZUIDMATPO=50&lt;BR /&gt;/BIC/TZUIDMATPO&lt;BR /&gt;/BIC/TZVSTBEST=50&lt;BR /&gt;/BIC/TZVSTBEST&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 11:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405481#M279172</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2017-10-19T11:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405482#M279173</link>
      <description>&lt;P&gt;It also has something to do withe the way Call execute Works.. I think.&lt;/P&gt;&lt;P&gt;I do not see why now... But this Works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; %macro Test(source);&lt;BR /&gt;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp; if _n_ = 1 then call symputx('obscnt',0);&lt;BR /&gt;&amp;nbsp; set SAP_prd."&amp;amp;source"n end=lastobs;&lt;BR /&gt;&amp;nbsp; if lastobs then Call symputx('obscnt', _N_);&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp; %put &amp;amp;source=&amp;amp;obscnt;&lt;BR /&gt;&amp;nbsp; %if &amp;amp;obscnt &amp;gt; 0 %then %do;&lt;BR /&gt;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp; %mend;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data all_columns&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp; dataset =&amp;nbsp;&amp;nbsp;&amp;nbsp; '/BI0/TPROFIT_CTR'&amp;nbsp;&amp;nbsp;&amp;nbsp; ; output;&lt;BR /&gt;&amp;nbsp; dataset =&amp;nbsp;&amp;nbsp;&amp;nbsp; '/BI0/TMATERIAL'&amp;nbsp;&amp;nbsp; ; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Filename test temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; file test;&lt;BR /&gt;&amp;nbsp; set all_columns;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Kode = '%Test(source='||strip(dataset)||')';&lt;BR /&gt;&amp;nbsp;put kode;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;%INC test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try it !&lt;/P&gt;&lt;P&gt;(note that I changed the libname to make it fit in my Place)&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 11:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405482#M279173</guid>
      <dc:creator>PSNn</dc:creator>
      <dc:date>2017-10-19T11:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro - number of records to go further</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405488#M279174</link>
      <description>&lt;P&gt;Thanks PSNn, now it works... I also don't really understand the call execute and the initialization of the macrovariables and how it works in runtime, but I knew it had to be something in that direction &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 12:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-number-of-records-to-go-further/m-p/405488#M279174</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2017-10-19T12:08:59Z</dc:date>
    </item>
  </channel>
</rss>

