<?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: The dataset created is  0 rows and 73 columns. Why did it happen? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409227#M67158</link>
    <description />
    <pubDate>Tue, 31 Oct 2017 17:20:27 GMT</pubDate>
    <dc:creator>Jaaa</dc:creator>
    <dc:date>2017-10-31T17:20:27Z</dc:date>
    <item>
      <title>The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409225#M67157</link>
      <description>&lt;P&gt;Dear SAS professionals,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a table by using the other two but the resulted dataset is completely empty, anyone who might have a idea about the reasons? Many thanks for your help in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;212  proc sql;
213    create table mydata as select *
214    from compx2 as a, LinkTable as b
215    where a.char_cusip = b.cusip and
216    b.LINKTYPE in ("LC", "LS", "LU", "LX", "LD", "LN") and
217   (b.LINKDT &amp;lt;= a.endfyr or b.LINKDT = .B) and (a.endfyr &amp;lt;= b.LINKENDDT or b.LINKENDDT = .E)
217! ;
NOTE: Table SIQI_IO.MYDATA created, with 0 rows and 73 columns.

218  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.37 seconds
      cpu time            0.40 seconds&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2017 17:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409225#M67157</guid>
      <dc:creator>Jaaa</dc:creator>
      <dc:date>2017-10-31T17:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409227#M67158</link>
      <description />
      <pubDate>Tue, 31 Oct 2017 17:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409227#M67158</guid>
      <dc:creator>Jaaa</dc:creator>
      <dc:date>2017-10-31T17:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409234#M67159</link>
      <description>It's something in your WHERE clause, remove them one by one and see which one is causing you to lose your records.</description>
      <pubDate>Tue, 31 Oct 2017 17:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409234#M67159</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-31T17:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409243#M67160</link>
      <description>&lt;P&gt;Most likely no records met the requirements in the Where clause.&lt;/P&gt;
&lt;P&gt;Please see this code for a brief example that does the same thing with fewer variables and easy to see mismatch in the values on the where clause:&lt;/P&gt;
&lt;PRE&gt;data one;
   input x y;
datalines;
1 2
3 4
5 6
;
run;

data two;
   input x z;
datalines;
10 20
20 30
40 50
;
run;

proc sql;
   create table work.junk as
   select a.*, b.z
   from one as a, two as b
   where a.x=b.x
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;With only 3 records it is easy to see that x has no matches between the two example sets. But it builds an empty data set with all of the variables referenced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you have a much more complex example you will need to trace things if you expect them to work.&lt;/P&gt;
&lt;P&gt;I would start by starting with&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; a&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;char_cusip &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; b&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;cusip&lt;/P&gt;
&lt;P&gt;to see if you get any results. If you do then add in each of the "and" bits one at a time and see if one of them is failing.&lt;/P&gt;
&lt;P&gt;If you are comparing actual date values (possibly LINKDT or LINKENDDT) and your Endfyr is not a complete date but just a year&amp;nbsp;value that may be an issue.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 17:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409243#M67160</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-31T17:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409250#M67161</link>
      <description>&lt;P&gt;Thank you for your post, Reeza!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 1257843 observations read from the data set SIQI_IO.COMPX2.&lt;/P&gt;&lt;P&gt;NOTE: There were 21 observations read from the data set SIQI_IO.LINKTABLE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I tried your suggestion line by line and found actually the error should be starting from WHERE clause:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;85   proc sql;
86      create table mydata as select compx2.*, LinkTable.*
87     from compx2 as a, LinkTable as b
88     where a.char_cusip = b.cusip;
NOTE: Table SIQI_IO.MYDATA created, with 0 rows and 73 columns.

88 !                                 /*and
89     b.LINKTYPE in ("LC", "LS", "LU", "LX", "LD", "LN") and
90    (b.LINKDT &amp;lt;= a.endfyr or b.LINKDT = .B) and (a.endfyr &amp;lt;= b.LINKENDDT or b.LINKENDDT = .E)
90 ! ;          */
91   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.92 seconds
      cpu time            0.43 seconds


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Can you possibly spot the issue? Many thanks for your time with my enquiry!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 18:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409250#M67161</guid>
      <dc:creator>Jaaa</dc:creator>
      <dc:date>2017-10-31T18:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409260#M67164</link>
      <description>&lt;P&gt;Thank you very much for your example and explanations! It's truly helpful for my understanding!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I tried and found that&amp;nbsp;starting with WHERE clause, there is no result produced so the issue is there! Do you know why does it like that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LINKDT or LINKENDDT is actual daily numerical date variables&amp;nbsp;and Endfyr is just a year&amp;nbsp;value. However, this code is used to work but have no idea why it couldn't manage now....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will double check with the date issue and hopefully it can work eventually. Many thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 18:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409260#M67164</guid>
      <dc:creator>Jaaa</dc:creator>
      <dc:date>2017-10-31T18:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409269#M67165</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154651"&gt;@Jaaa&lt;/a&gt; wrote:&lt;BR /&gt;

&lt;P&gt;LINKDT or LINKENDDT is actual daily numerical date variables&amp;nbsp;and Endfyr is just a year&amp;nbsp;value. However, this code is used to work but have no idea why it couldn't manage now....&lt;/P&gt;

&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;

If one value is a year, and one is a SAS date that comparison wouldn't be correct. But if it worked before then I suggest you check your data, it's most likely a data issue.</description>
      <pubDate>Tue, 31 Oct 2017 19:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409269#M67165</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-31T19:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409315#M67166</link>
      <description>&lt;P&gt;If you Endfyr variable happened to be 2017 then likely the only dates less than that value are going to be before 10Jul 1965.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this code worked before either something such as Year(datevariable)&amp;lt; endfyr or your Endfyr variable was an actual date value such as '31DEC2016'd&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 23:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409315#M67166</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-31T23:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409401#M67171</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;If you Endfyr variable happened to be 2017 then likely the only dates less than that value are going to be before 10Jul 1965.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you for your reply! I'm bit confused so what do you mean by that?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 11:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409401#M67171</guid>
      <dc:creator>Jaaa</dc:creator>
      <dc:date>2017-11-01T11:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409436#M67179</link>
      <description>&lt;P&gt;I&amp;nbsp;think I found the&amp;nbsp;problem&amp;nbsp;is that the cusip length in both datasets is different. One is&amp;nbsp;8 digits and the other is 9 digits. However, when I used the following code to&amp;nbsp;increase its length, it still&amp;nbsp;didn't make any&amp;nbsp;difference. Do you possibly know how can I&amp;nbsp;achieve that?&amp;nbsp;Many thanks for your help indeed! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
informat cusip $9.;
format cusip $9.;
set mydata;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Nov 2017 12:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409436#M67179</guid>
      <dc:creator>Jaaa</dc:creator>
      <dc:date>2017-11-01T12:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409507#M67197</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154651"&gt;@Jaaa&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;If you Endfyr variable happened to be 2017 then likely the only dates less than that value are going to be before 10Jul 1965.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thank you for your reply! I'm bit confused so what do you mean by that?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If your year value is 2017 then that is its value. The numeric value of a date 01JAN2017, which is what would be used for comparison, is 20820 if the value is a SAS date value since SAS dates are number of days since 01Jan1960. So 2017 as a numeric value corresponds to 10Jul1965. So the only "dates" less than 2017&amp;nbsp; are prior to 10Jul1965. If your Endfyr value is an actual SAS date corresponding to 31DEC2017 (end of a calendar year) that would be a numeric value of 21184.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is reasons like this we request example data. We have no idea what actual values you have, what you are comparing and can't tell exactly what fails. I am guessing that you have date values, of some sort, since you have variable names ending in DT or YR&amp;nbsp;but if they are not all actually SAS date values then comparisons can get very sticky.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 15:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409507#M67197</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-01T15:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: The dataset created is  0 rows and 73 columns. Why did it happen?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409548#M67202</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154651"&gt;@Jaaa&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I&amp;nbsp;think I found the&amp;nbsp;problem&amp;nbsp;is that the cusip length in both datasets is different. One is&amp;nbsp;8 digits and the other is 9 digits. However, when I used the following code to&amp;nbsp;increase its length, it still&amp;nbsp;didn't make any&amp;nbsp;difference. Do you possibly know how can I&amp;nbsp;achieve that?&amp;nbsp;Many thanks for your help indeed! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
informat cusip $9.;
format cusip $9.;
set mydata;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What should the length be?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 17:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/The-dataset-created-is-0-rows-and-73-columns-Why-did-it-happen/m-p/409548#M67202</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-01T17:12:52Z</dc:date>
    </item>
  </channel>
</rss>

