<?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: Set data according to one variable in a table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Set-data-according-to-one-variable-in-a-table/m-p/452314#M283892</link>
    <description>&lt;P&gt;SAS date is a numeric variable containing number of days since 01JAN1960.&lt;/P&gt;
&lt;P&gt;In order to assign the date in a format of yyyymmdd into a macro variable yyyyyo need to reformat it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the table you have a lot of different dates. Which of them you want to assign to the macro variable?&lt;/P&gt;
&lt;P&gt;and how did you try to do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a singlae date can be assigned to a macro variable, in a sas datastep, using&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;call symput('macro_var', put(date_var, yymmdd8.);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better post your full code in oredr to get more accurate answer.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Apr 2018 13:13:06 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2018-04-08T13:13:06Z</dc:date>
    <item>
      <title>Set data according to one variable in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-data-according-to-one-variable-in-a-table/m-p/452300#M283891</link>
      <description>&lt;P&gt;Say I have a table containing date variable and I want to recursively&amp;nbsp;referring to taq libraries such as:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data zzz;
	set taqms.&amp;amp;type._&amp;amp;yyyymmdd;
	if ('9:35:00't) &amp;lt;= time_m &amp;lt;=('14:35:00't);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where &amp;amp;type=ctm and&amp;nbsp;&amp;amp;yyyymmdd is the date variable converted in to the form "yyyymmdd"&amp;nbsp; inside a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the %let command do not work well with date type variable and I am not able to assign the specific row observation to the &amp;amp;yyyymmdd variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, the date table:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="WeChat Image_20180408055009.png" style="width: 242px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19686i8B93DD07878FF0D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="WeChat Image_20180408055009.png" alt="WeChat Image_20180408055009.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And I want to&amp;nbsp;&lt;SPAN&gt;recursively&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;referring to taq libraries&amp;nbsp;according to the date values above.&lt;/SPAN&gt;&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>Sun, 08 Apr 2018 09:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-data-according-to-one-variable-in-a-table/m-p/452300#M283891</guid>
      <dc:creator>Sasadomo</dc:creator>
      <dc:date>2018-04-08T09:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set data according to one variable in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-data-according-to-one-variable-in-a-table/m-p/452314#M283892</link>
      <description>&lt;P&gt;SAS date is a numeric variable containing number of days since 01JAN1960.&lt;/P&gt;
&lt;P&gt;In order to assign the date in a format of yyyymmdd into a macro variable yyyyyo need to reformat it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the table you have a lot of different dates. Which of them you want to assign to the macro variable?&lt;/P&gt;
&lt;P&gt;and how did you try to do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a singlae date can be assigned to a macro variable, in a sas datastep, using&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;call symput('macro_var', put(date_var, yymmdd8.);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better post your full code in oredr to get more accurate answer.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 13:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-data-according-to-one-variable-in-a-table/m-p/452314#M283892</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-08T13:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set data according to one variable in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-data-according-to-one-variable-in-a-table/m-p/452348#M283893</link>
      <description>&lt;P&gt;Thank you for your response. I&amp;nbsp;would like to assign every date (each at the time, I have a do loop in the macro function) to the macro and perform something like this:&lt;/P&gt;&lt;PRE&gt;proc sql; create table temp as &lt;BR /&gt; select a.*, b.cusip, b.secd&lt;BR /&gt; from taqms.&amp;amp;type._&amp;amp;day a, loca2 b&lt;BR /&gt; where a.sym_root=b.symbol and (b.sect-&amp;amp;window) &amp;lt;= a.time_m &amp;lt;= (b.sect+&amp;amp;window)&lt;BR /&gt; order by b.symbol;&lt;BR /&gt;quit; &lt;/PRE&gt;&lt;P&gt;where loca2 is link table for smybol and cusip.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 18:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-data-according-to-one-variable-in-a-table/m-p/452348#M283893</guid>
      <dc:creator>Sasadomo</dc:creator>
      <dc:date>2018-04-08T18:04:50Z</dc:date>
    </item>
  </channel>
</rss>

