<?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: Selecting data based on fixed date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594319#M170730</link>
    <description>&lt;P&gt;Perfect. And what is the type of the Date&amp;nbsp;variable? (Num or Char). Is it already recognize as a date ?&lt;/P&gt;</description>
    <pubDate>Sun, 06 Oct 2019 09:31:23 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2019-10-06T09:31:23Z</dc:date>
    <item>
      <title>Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594313#M170724</link>
      <description>&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;price&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19890731&lt;/TD&gt;&lt;TD&gt;1.981&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19900731&lt;/TD&gt;&lt;TD&gt;1.287&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19910731&lt;/TD&gt;&lt;TD&gt;1.792&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19921231&lt;/TD&gt;&lt;TD&gt;7.271&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19931231&lt;/TD&gt;&lt;TD&gt;13.017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19941231&lt;/TD&gt;&lt;TD&gt;22.317&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19981231&lt;/TD&gt;&lt;TD&gt;27.857&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19991231&lt;/TD&gt;&lt;TD&gt;26.242&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20001231&lt;/TD&gt;&lt;TD&gt;35.12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20011231&lt;/TD&gt;&lt;TD&gt;12.808&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20021231&lt;/TD&gt;&lt;TD&gt;11.907&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19901231&lt;/TD&gt;&lt;TD&gt;5.656&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19911231&lt;/TD&gt;&lt;TD&gt;3.85&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the above data I want to keep data related 31st December. So, I need code for YR1231. Please help&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 09:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594313#M170724</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-10-06T09:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594315#M170726</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe this is something you can try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input Date yymmdd8. price;
	format Date date9.;
	cards;
19890731	1.981
19900731	1.287
19910731	1.792
19921231	7.271
19931231	13.017
19941231	22.317
19981231	27.857
19991231	26.242
20001231	35.12
20011231	12.808
20021231	11.907
19901231	5.656
19911231	3.85
;
run;

data want;
	set have;
	where month(date)=12 and day(date)=31;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this help.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 09:17:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594315#M170726</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-10-06T09:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594316#M170727</link>
      <description>Hi, how will I do that without input command?</description>
      <pubDate>Sun, 06 Oct 2019 09:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594316#M170727</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-10-06T09:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594317#M170728</link>
      <description>&lt;P&gt;Hi, is your file already a SAS dataset?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 09:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594317#M170728</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-10-06T09:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594318#M170729</link>
      <description>Yes</description>
      <pubDate>Sun, 06 Oct 2019 09:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594318#M170729</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-10-06T09:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594319#M170730</link>
      <description>&lt;P&gt;Perfect. And what is the type of the Date&amp;nbsp;variable? (Num or Char). Is it already recognize as a date ?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 09:31:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594319#M170730</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-10-06T09:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594320#M170731</link>
      <description>I think it is num. It is exactly what I have given in the example. So, I have a large data set. I imported the excel in which date is given in the same style as my example</description>
      <pubDate>Sun, 06 Oct 2019 09:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594320#M170731</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-10-06T09:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594321#M170732</link>
      <description>&lt;P&gt;OK. I encourage you to check the variable type / format / etc. by using a proc contents:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=have;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;If it is a character variable, you will a have to convert it using the input() function or the substr() function depending if you need to have this variable as a date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If it is a numeric variable, you will a have to apply a date format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 09:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594321#M170732</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-10-06T09:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594322#M170733</link>
      <description>Alphabetic List of Variables and Attributes&lt;BR /&gt;# Variable Type Len Label&lt;BR /&gt;4 Assets Num 8 Assets&lt;BR /&gt;2 Date Num 8 Date&lt;BR /&gt;5 Earnings Num 8 Earnings&lt;BR /&gt;3 FY Num 8 FY&lt;BR /&gt;1 gvkey Num 8 gvkey&lt;BR /&gt;&lt;BR /&gt;This is what I have</description>
      <pubDate>Sun, 06 Oct 2019 09:40:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594322#M170733</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-10-06T09:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594323#M170734</link>
      <description>So, I have attached example of my data. Please download it and use proc import to import the data. Then what code should I use to get my desired result?</description>
      <pubDate>Sun, 06 Oct 2019 09:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594323#M170734</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-10-06T09:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594324#M170735</link>
      <description>&lt;P&gt;Could you please try this ?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have2;
	set have;
	format date2 date9.;
	date2 = input(put(date,8.),yymmdd8.); /* Date2 = date in a date format*/
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Oct 2019 09:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594324#M170735</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-10-06T09:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594325#M170736</link>
      <description>Thank you very much. It worked</description>
      <pubDate>Sun, 06 Oct 2019 09:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594325#M170736</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-10-06T09:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting data based on fixed date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594326#M170737</link>
      <description>&lt;P&gt;Awesome! Have a great day.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 09:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-data-based-on-fixed-date/m-p/594326#M170737</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-10-06T09:53:14Z</dc:date>
    </item>
  </channel>
</rss>

