<?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 Help with code in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301356#M60598</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two datasets, one with stock prices and the other with Foreign Ownership (See sample attached). I&amp;nbsp;want to calculate the&amp;nbsp;cross sectional deviation of returns (CSAD), based on the level of foreign ownership of each firm.&lt;/P&gt;
&lt;P&gt;Specifically, instead of calculating CSAD on all stocks (as in my code), I want to calculate this on stocks with FR&amp;gt;5;&amp;nbsp;so for each day only the firms with FR&amp;gt;5,&amp;nbsp;which is on the second dataset, should be used in order to calculate CSAD in the "data Step1" command&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another thing I would like to do is create a macro variable with the number of stocks, so that I don't have to manually adjust these on each dataset (numbers in arrays)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas to sort these out?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Import Datasets;

PROC IMPORT OUT=PRICES
 DATAFILE= "C:\Users\Laptop\Desktop\DATA.xlsx"
DBMS=XLSX REPLACE;
 SHEET="Sheet1";
GETNAMES=YES;
 RUN;

PROC IMPORT OUT=FR
 DATAFILE= "C:\Users\Laptop\Desktop\DATA.xlsx"
DBMS=XLSX REPLACE;
 SHEET="Sheet2";
GETNAMES=YES;
 RUN;

*Remove all variables with 'Error';

 proc sql noprint;

    select trim(compress(name))
    into :drop_vars separated by ' '
    from SASHELP.VCOLUMN 
    where libname = upcase('WORK')
        and
            memname = upcase('PRICES')
        and
            upcase(name) like '%ERROR%'
    ;
quit;

%put &amp;amp;drop_vars.;

data PRICE;
    set PRICES;
    drop  &amp;amp;drop_vars.;
run;

proc sql noprint;

    select trim(compress(name))
    into :drop_vars separated by ' '
    from SASHELP.VCOLUMN 
    where libname = upcase('WORK')
        and
            memname = upcase('FR')
        and
            upcase(name) like '%ERROR%'
    ;
quit;

%put &amp;amp;drop_vars.;

data FR2;
    set FR;
    drop  &amp;amp;drop_vars.;
run;

*Calculate Cross Sectional Absolute Deviation of Returns;

data Step1;

set PRICE;

N= n(of TELECOM_ARGENTINA--GRUPO_FINO_GALICIA_DEAD___DELIST);

  array vars(*) TELECOM_ARGENTINA--GRUPO_FINO_GALICIA_DEAD___DELIST;

  array diff(&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

  do i=1 to dim(vars);

    diff(i)=log(vars(i)/lag(vars(i)));

  end;
Average= mean(of diff1-diff&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

array var(*) diff1--diff&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;;

  array ar(&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

  do i=1 to dim(var);

    ar(i)=(var(i)-average);

  end;
 
array vas(*) ar1--ar&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;;

  array ab(&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

  do i=1 to dim(vas);

    ab(i)=abs(vas(i));
	end;
run; 

data Step2;
set Step1; 
CSAD= sum(of ab1-ab&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;)/n;
abs=abs(Average);
sqr=Average*Average;
keep date average CSAD abs sqr;
run
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2016 17:27:26 GMT</pubDate>
    <dc:creator>Costasg</dc:creator>
    <dc:date>2016-09-28T17:27:26Z</dc:date>
    <item>
      <title>Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301356#M60598</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two datasets, one with stock prices and the other with Foreign Ownership (See sample attached). I&amp;nbsp;want to calculate the&amp;nbsp;cross sectional deviation of returns (CSAD), based on the level of foreign ownership of each firm.&lt;/P&gt;
&lt;P&gt;Specifically, instead of calculating CSAD on all stocks (as in my code), I want to calculate this on stocks with FR&amp;gt;5;&amp;nbsp;so for each day only the firms with FR&amp;gt;5,&amp;nbsp;which is on the second dataset, should be used in order to calculate CSAD in the "data Step1" command&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another thing I would like to do is create a macro variable with the number of stocks, so that I don't have to manually adjust these on each dataset (numbers in arrays)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas to sort these out?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Import Datasets;

PROC IMPORT OUT=PRICES
 DATAFILE= "C:\Users\Laptop\Desktop\DATA.xlsx"
DBMS=XLSX REPLACE;
 SHEET="Sheet1";
GETNAMES=YES;
 RUN;

PROC IMPORT OUT=FR
 DATAFILE= "C:\Users\Laptop\Desktop\DATA.xlsx"
DBMS=XLSX REPLACE;
 SHEET="Sheet2";
GETNAMES=YES;
 RUN;

*Remove all variables with 'Error';

 proc sql noprint;

    select trim(compress(name))
    into :drop_vars separated by ' '
    from SASHELP.VCOLUMN 
    where libname = upcase('WORK')
        and
            memname = upcase('PRICES')
        and
            upcase(name) like '%ERROR%'
    ;
quit;

%put &amp;amp;drop_vars.;

data PRICE;
    set PRICES;
    drop  &amp;amp;drop_vars.;
run;

proc sql noprint;

    select trim(compress(name))
    into :drop_vars separated by ' '
    from SASHELP.VCOLUMN 
    where libname = upcase('WORK')
        and
            memname = upcase('FR')
        and
            upcase(name) like '%ERROR%'
    ;
quit;

%put &amp;amp;drop_vars.;

data FR2;
    set FR;
    drop  &amp;amp;drop_vars.;
run;

*Calculate Cross Sectional Absolute Deviation of Returns;

data Step1;

set PRICE;

N= n(of TELECOM_ARGENTINA--GRUPO_FINO_GALICIA_DEAD___DELIST);

  array vars(*) TELECOM_ARGENTINA--GRUPO_FINO_GALICIA_DEAD___DELIST;

  array diff(&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

  do i=1 to dim(vars);

    diff(i)=log(vars(i)/lag(vars(i)));

  end;
Average= mean(of diff1-diff&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

array var(*) diff1--diff&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;;

  array ar(&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

  do i=1 to dim(var);

    ar(i)=(var(i)-average);

  end;
 
array vas(*) ar1--ar&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;;

  array ab(&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;);

  do i=1 to dim(vas);

    ab(i)=abs(vas(i));
	end;
run; 

data Step2;
set Step1; 
CSAD= sum(of ab1-ab&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;179&lt;/FONT&gt;&lt;/STRONG&gt;)/n;
abs=abs(Average);
sqr=Average*Average;
keep date average CSAD abs sqr;
run
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 17:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301356#M60598</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2016-09-28T17:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301406#M60602</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont have too much time to actually try this. &amp;nbsp;I'm just trying to give you an overall idea.&lt;/P&gt;
&lt;P&gt;However my suggestion is only viable if the following is true from your write up and my quick read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your write up you are trying to avoid manually figuring out the "n" in which to divide or do the calculation by.&lt;/P&gt;
&lt;P&gt;If that is the case (generally) then here is my suggestion mock up.&lt;/P&gt;
&lt;P&gt;I suggest using the idea of letting the "data" drive code (in this case format) to then use within your code.&lt;/P&gt;
&lt;P&gt;I hope my pseudo code allows the suggested idea to come thru for you to then put into your own work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hth&lt;/P&gt;
&lt;P&gt;best&lt;/P&gt;
&lt;P&gt;zeke torres&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.wcsug.com" target="_self"&gt;www.wcsug.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/** take data and create a freq of ownership to get 'n' ***/
proc freq data=work.fr ;
table var_to_count ;
output out=work.counted;
run;&lt;BR /&gt;&lt;BR /&gt;/** you will need to play with this to get the desired columns to use later **/&lt;BR /&gt;/** in my idea you would need the column for ownership and the 'count' **/

data work.counted;
 set work.counted;
 /** prep for use with format and cntlin **/
 /** create label, fmt name, fmt type etc **/&lt;BR /&gt; /** the link below in proc format shows a good example of proc format cntlin **/&lt;BR /&gt; /** also look up Wendi Wrights papers on proc format because she rocks with it **/
run;

proc format cntlin=work.counted;
    /** see example: http://www2.sas.com/proceedings/forum2007/068-2007.pdf **/
run;

/** then set n value based on count to data  using format **/
data work.nowtry;
   set work.fr;
   count= put(var_to_apply_count , $fmtname.);
   /** then do  your math using new count var **/
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Sep 2016 21:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301406#M60602</guid>
      <dc:creator>zekeT_sasaholic</dc:creator>
      <dc:date>2016-09-28T21:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301417#M60603</link>
      <description>&lt;P&gt;How do you determine when FR&amp;gt;5? I don't see a variable of that name, FR,&amp;nbsp;in either sheet of your example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also suspect that this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data FR2;
    set FR;
    drop  _ERR: ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;might get rid of all of those error variables without the SQL and macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I personally would be very concerned about receiving input data with that many column headings of Error.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 22:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301417#M60603</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-28T22:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301463#M60605</link>
      <description>&lt;P&gt;Thanks for your reply. Data is from Thomson Datastream so this is what I have to work with. Sheet 1 contains prices and Sheet 2 contains FR for the same stocks (not all stocks have a vailable data on FR, so these are less). So, what I want to do is keep the observations in prices (sheet1 or dataset Prices)&amp;nbsp;only when for the same day the FR of the company is &amp;gt;5 (Sheet 2 or dataset FR). Eventually what I want to do seems like that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data prices;
input Date $ 1-10 ARG YPF BBVA CENTRAL ; 
cards;
01/01/2003 3.21 5.27 7.23 9.88
02/01/2003 3.23 5.30 7.20 9.78
03/01/2003 3.26 5.32 7.18 9.70
04/01/2003 3.23 5.38 7.20 9.71
05/01/2003 3.20 5.35 7.19 9.80
;;;

data FR;
input Date $ 1-10 ARG YPF BBVA CENTRAL ; 
cards;
01/01/2003 3 11 7 .
02/01/2003 3 11 7 .
03/01/2003 3 11 7 .
04/01/2003 6 11 4 .
05/01/2003 6 11 4 .
;;;

data need;
input Date $ 1-10 ARG YPF BBVA CENTRAL ; 
cards;
01/01/2003 . 5.27 7.23 .
02/01/2003 . 5.30 7.20 .
03/01/2003 . 5.32 7.18 .
04/01/2003 3.23 5.38 . .
05/01/2003 3.20 5.35 . .
;;;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Sep 2016 08:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301463#M60605</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2016-09-29T08:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301545#M60620</link>
      <description>&lt;P&gt;Please &lt;STRONG&gt;define FR&lt;/STRONG&gt;. SAS speaks variables and values. When you say FR&amp;gt;5 then we need a rule to turn variables and values into FR to compare to the value 5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2016 14:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301545#M60620</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-29T14:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301585#M60627</link>
      <description>&lt;P&gt;Hi ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see the attached excel file. This is how the data is downloaded from Datastream.&amp;nbsp;The&amp;nbsp;stock prices are in&amp;nbsp;Sheet 1 (e.g. TELECOM ARGENTINA)&amp;nbsp;and&amp;nbsp;the foreign holdings (FR)&amp;nbsp;in Sheet 2 (e.g.&amp;nbsp;TELECOM ARGENTINA - FOREIGN HOLDINGS).&amp;nbsp;So, I would like to keep the stock price of&amp;nbsp;TELECOM ARGENTINA for every observation only when&amp;nbsp;TELECOM ARGENTINA - FOREIGN HOLDINGS is greater than&amp;nbsp;5 for the same observation.&lt;/P&gt;
&lt;P&gt;I just thought that it would be easier to have the same names in the two databases and maybe merge somehow the two of them.&lt;/P&gt;
&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 10:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301585#M60627</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2016-09-30T10:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301749#M60649</link>
      <description>&lt;P&gt;I managed to figure out a way to do what I want by transposing the two datasets and merging them. If someone has any suggestions on how to make this faster, please feel free to comment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, how could I create a macro to count the variables in order not to mannually write each time COL1--COL25 and then in&amp;nbsp;each of the&amp;nbsp;arrays the number of variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Import Datasets;

PROC IMPORT OUT=PRICE
 DATAFILE= "C:\Users\Laptop\Desktop\DATA.xlsx"
DBMS=XLSX REPLACE;
 SHEET="Sheet1";
GETNAMES=YES;
 RUN;

PROC IMPORT OUT=FR
 DATAFILE= "C:\Users\Laptop\Desktop\DATA.xlsx"
DBMS=XLSX REPLACE;
 SHEET="Sheet2";
GETNAMES=YES;
 RUN;

*Remove all variables with 'Error';

 data price;
    set price;
    drop  _ERR: ;
run;

data fr;
    set fr;
    drop  _ERR: ;
run;

*transpose and sort tables;

proc transpose data=price out=pr(rename=(col1=Price));;
by date;
var TELECOM_ARGENTINA--GRUPO_FINO_GALICIA_DEAD___DELIST;
run;

proc sort data=pr;
by date _LABEL_;
run;

proc transpose data=fr out=fr2(rename=(col1=FR));;
by date;
var TELECOM_ARGENTINA--CENTRAL_PUERTO_SOCIEDAD_ANONIMA;
run;

proc sort data=fr2;
by date _LABEL_;
run;

*merge tables;

data data;
merge pr fr2;
by date _LABEL_;
run;

*keep observations with FR&amp;gt;5;

data data2;
set data;
where Fr&amp;gt;5;
drop FR _NAME_;
run;

*Transpose table;
proc transpose data=data2 out=data3(drop=_NAME_);
by DATE;
run;


*Calculate Cross Sectional Absolute Deviation of Returns;

data Step1;

set data3;

N= n(of COL1--COL25);

  array vars(*) COL1--COL25;

  array diff(25);

  do i=1 to dim(vars);

    diff(i)=log(vars(i)/lag(vars(i)));

  end;
Average= mean(of diff1-diff25);

array var(*) diff1--diff25;

  array ar(25);

  do i=1 to dim(var);

    ar(i)=(var(i)-average);

  end;
 
array vas(*) ar1--ar25;

  array ab(25);

  do i=1 to dim(vas);

    ab(i)=abs(vas(i));
	end;
run; 

data Step2;
set Step1; 
CSAD= sum(of ab1-ab25)/n;
abs=abs(Average);
sqr=Average*Average;
keep date average CSAD abs sqr;
if CSAD=0 then delete;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Sep 2016 12:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301749#M60649</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2016-09-30T12:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301830#M60657</link>
      <description>&lt;P&gt;Here is a little helper macro.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro NumVars(dataset=, LastVar=, FirstVar=,MvarName=);
%global &amp;amp;MvarName;
data _null_;
   dsid   = open("&amp;amp;dataset","i");
   Last   = varnum(dsid,"&amp;amp;LastVar");
   First  = varnum(dsid,"&amp;amp;FirstVar");
   NumVars= Last - first +1;
   rc     = close(dsid);
   call symputx("&amp;amp;MvarName",Numvars);
run;
%mend;

%NumVars(dataset=price , LastVar = GRUPO_FINO_GALICIA_DEAD___DELIST, FirstVar = TELECOM_ARGENTINA, MvarName = dvar);
%put &amp;amp;dvar;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can specify the name of the resultant macro variable to use in the places where you need the number of variables such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Col1 - Col&amp;amp;dvar&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Array ar( &amp;amp;dvar);&lt;/P&gt;
&lt;P&gt;Note this works only because the variables you want are in sequence in the data.&lt;/P&gt;
&lt;P&gt;Execute the Macro (the %NUMVARS line) BEFORE the first time that you need the value for any thing but AFTER you have run the macro definition code (the code that starts with %macro and ends with %mend).&lt;/P&gt;
&lt;P&gt;Bad things will happen if you don't put the first and last variable names in the right place, misspell them or point to the wrong dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 21:06:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301830#M60657</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-30T21:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301913#M60661</link>
      <description>&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 02 Oct 2016 14:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-code/m-p/301913#M60661</guid>
      <dc:creator>Costasg</dc:creator>
      <dc:date>2016-10-02T14:15:12Z</dc:date>
    </item>
  </channel>
</rss>

