<?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: How to split a large dataset by certain requirements? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306111#M60965</link>
    <description>&lt;P&gt;Thanks. I finally figured out the source of the problem. Since _ric is a characteristic variables, I should put extra ' ' to tell SAS that is characteristic variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my final code is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;_ric='"||input(_ric,$13.)||"'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2016 22:08:19 GMT</pubDate>
    <dc:creator>Neal0801</dc:creator>
    <dc:date>2016-10-20T22:08:19Z</dc:date>
    <item>
      <title>How to split a large dataset by certain requirements?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/305983#M60950</link>
      <description>&lt;PRE&gt;data AXPM061204200; 
set a; 
call execute ("data work.data_"||strip(put(_ric,$13.))||"_"||strip(put(date,yymmddn8.))||"; 
               set work.a;if date="||date||" and _ric="||input(_ric,$13.)||";run;"); 
run;&lt;/PRE&gt;&lt;P&gt;I have a large dataset that contians multiple date (from 20120103 to 20121205) and contracts (_ric= AXPM061204200.c, AXPC061204200.c and so on).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use "call exectue" to split the dataset and here is my code. It can only split by date, but fail in contract name (_ric). The error was : Variable AXPM061203800 is uninitialized. How could I solve this problem.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 15:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/305983#M60950</guid>
      <dc:creator>Neal0801</dc:creator>
      <dc:date>2016-10-20T15:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a large dataset by certain requirements?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306056#M60954</link>
      <description>&lt;P&gt;If you run it with the following options and examine your&amp;nbsp;log you'll see the exact code that's being created. There's something in the code that's incorrect, but sometimes hard to see in the current format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 19:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306056#M60954</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-20T19:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a large dataset by certain requirements?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306062#M60955</link>
      <description>&lt;P&gt;The code in the IF conditions generates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and _ric=some_value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But _RIC is a character variable, so you need quotes in the generated statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and _ric="some_value"&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 19:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306062#M60955</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-20T19:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a large dataset by certain requirements?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306064#M60956</link>
      <description>&lt;P&gt;A couple hints when working with Call execute.&lt;/P&gt;
&lt;P&gt;1) It is often easier to define a long string variable for the argument of Call execute and then use some thing like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute (string);&lt;/P&gt;
&lt;P&gt;2) you can use put statements to check the value of the string to see if things look right.&lt;/P&gt;
&lt;P&gt;3) use the CAT functions such as CATS or CATX. The venerable || operator often results in undesired spaces leading or trailing bits of your code.&lt;/P&gt;
&lt;P&gt;4. Instead of trying to force:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data work.data_longnamehere;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set work.if;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If date= "some obnoxious value" and _ric="some other value";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;Into a single call execute do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('Data work.data_longnameconstructhere;');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('set work.if;');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('If date= "some obnoxious value" and _ric="some other value";');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('run;');&lt;/P&gt;
&lt;P&gt;You can see in the second bit above that two of the 4 lines don't change so the construction of the "string" variable would be easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This bit of your code: strip(put&lt;WBR /&gt;(date,yymmddn8.))||";&amp;nbsp; inicates that DATE is a SAS date valued numeric.&lt;/P&gt;
&lt;P&gt;I think: date="||date||"&amp;nbsp;is doing something unnatural for numerics and _ric="||input(_ric,$13.)||" as a comparison should likely fail as a variable with more than 13 characters will never &lt;STRONG&gt;equal&lt;/STRONG&gt; the first 13 characters. And what is wrong with substr?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 19:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306064#M60956</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-20T19:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a large dataset by certain requirements?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306095#M60963</link>
      <description>&lt;P&gt;You &lt;A href="http://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_self"&gt;might also be able to adapt this approach&lt;/A&gt;, which doesn't rely on CALL EXECUTE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 20:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306095#M60963</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-10-20T20:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a large dataset by certain requirements?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306111#M60965</link>
      <description>&lt;P&gt;Thanks. I finally figured out the source of the problem. Since _ric is a characteristic variables, I should put extra ' ' to tell SAS that is characteristic variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my final code is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;_ric='"||input(_ric,$13.)||"'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 22:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-split-a-large-dataset-by-certain-requirements/m-p/306111#M60965</guid>
      <dc:creator>Neal0801</dc:creator>
      <dc:date>2016-10-20T22:08:19Z</dc:date>
    </item>
  </channel>
</rss>

