<?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: Creating Datasets from a parent dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783551#M249863</link>
    <description>&lt;P&gt;Do you want to have it in SAS or in Oracle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In sas you can use firstobs= and obs= dataset options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
  do i = 1 to 10;
    output;
  end;
run;

data B;
 set A (obs=7);
run;
proc print;
run;

data C;
  set A (firstobs=8);
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But when you are pulling data from a data base I'm not sure if the data order is guaranteed.&lt;/P&gt;
&lt;P&gt;Maybe if there is some sort of primary key which can allow to select all values less than "some value" to the first set and then all greater than equal from that "value" to the other set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Dec 2021 07:23:41 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2021-12-02T07:23:41Z</dc:date>
    <item>
      <title>Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783549#M249861</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am having an oracle error as my source&amp;nbsp;table is in oracle DB and the count of that table is more than 4,294,967,296. That is not supported in my current version but i need to submit my delivery on time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;so can you help me that if there are&amp;nbsp;4400000000 total records in dataset A ( table in oracle) and i want my first 4000000000 to be in dataset B from dataset A and rest&amp;nbsp;294,967,296 record in dataset C .&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and in last i will append dataset B and dataset C to process further. Can you help me with the bold part? above thanks !!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 07:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783549#M249861</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2021-12-02T07:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783551#M249863</link>
      <description>&lt;P&gt;Do you want to have it in SAS or in Oracle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In sas you can use firstobs= and obs= dataset options:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A;
  do i = 1 to 10;
    output;
  end;
run;

data B;
 set A (obs=7);
run;
proc print;
run;

data C;
  set A (firstobs=8);
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But when you are pulling data from a data base I'm not sure if the data order is guaranteed.&lt;/P&gt;
&lt;P&gt;Maybe if there is some sort of primary key which can allow to select all values less than "some value" to the first set and then all greater than equal from that "value" to the other set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 07:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783551#M249863</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-12-02T07:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783558#M249869</link>
      <description>&lt;P&gt;Do you really want to transfer 4 billion observations from SAS to Oracle? Why? How often do you need to refresh that data? What's the expected runtime?&lt;/P&gt;
&lt;P&gt;If the limit you have is because you use a 32-bit platform, this kind of volume seems much too large.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The trouble is that Oracle may not always send the data in the same order, so if you can't use data values to determine the output table, you need to do this in one step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data B C;
  set A;
  if _N_&amp;lt;=4e9 then output B; else output C;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 08:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783558#M249869</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-12-02T08:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783569#M249876</link>
      <description>hey I don't want from SAS to oracle , from oracle to SAS i want to read these many records&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Dec 2021 09:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783569#M249876</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2021-12-02T09:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783570#M249877</link>
      <description>I have tried obs option , but my table is in ORACLE so i need to use proc sql maybe.</description>
      <pubDate>Thu, 02 Dec 2021 09:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783570#M249877</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2021-12-02T09:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783572#M249879</link>
      <description>&lt;P&gt;So you need to create two separate tables in Oracle to accommodate the limits there?&lt;/P&gt;
&lt;P&gt;Create a LIBNAME to the Oracle DB and schema, then run a variation of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;'s code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data
  oracle.B
  oracle.C
;
set A;
if _N_ &amp;lt;= 4e9
then output oracle.B;
else output oracle.C;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Dec 2021 09:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783572#M249879</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-02T09:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783600#M249899</link>
      <description>my source table is in ORACLE and SAS is not able to read such many observation... &lt;BR /&gt;source table A &lt;BR /&gt;oracle.datasetA --- 4400000000  records&lt;BR /&gt;this i want spilt into 2 tables so that atleast I can read the data. &lt;BR /&gt;&lt;BR /&gt;If you know any option in SAS that can help&lt;BR /&gt;I don't want to create two separate tables in Oracle to accommodate the limits there</description>
      <pubDate>Thu, 02 Dec 2021 12:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783600#M249899</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2021-12-02T12:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783628#M249922</link>
      <description>&lt;P&gt;If you can't even open the table from SAS to SET it in a data step, then you need to split it on the Oracle side.&lt;/P&gt;
&lt;P&gt;This will need to be done in SQL.&lt;/P&gt;
&lt;P&gt;I would define two views and use a variable along which you can easily split the data, like a transaction date or so.&lt;/P&gt;
&lt;P&gt;Then, read the views separately.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 14:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783628#M249922</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-02T14:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783653#M249937</link>
      <description>Is your Oracle table indexed? Honestly not seeing a way to process this all at once easily in a reasonable time frame.&lt;BR /&gt;I would partition my data, index it, and use PL/SQL to loop through all of them. &lt;BR /&gt;</description>
      <pubDate>Thu, 02 Dec 2021 15:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783653#M249937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-02T15:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783696#M249966</link>
      <description>Can you help me with the query?</description>
      <pubDate>Thu, 02 Dec 2021 16:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/783696#M249966</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2021-12-02T16:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/784012#M250110</link>
      <description>&lt;P&gt;Consult the Oracle documentation for CREATE VIEW (that's what I would also need to do). Furthermore, get in touch with your Oracle admins with regards to the necessary permissions and other technical details.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 20:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/784012#M250110</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-03T20:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Datasets from a parent dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/784041#M250122</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345043"&gt;@librasonali&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;my source table is in ORACLE and SAS is not able to read such many observation... &lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is not such limit to my knowledge. What is your statement based on? Do you get a timeout or the like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oracle doesn't have a concept of row numbers and furthermore the only way to ensure Oracle returns rows always in the same order is to use an order by statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The normal approach is to reduce data volumes on the DB side prior to transferring it into SAS. The transfer from the DB to SAS is the likely bottleneck and could take a long time to run.&lt;/P&gt;
&lt;P&gt;Do you really need the full table with all the detail on the SAS side or could you first reduce volumes on the DB side (like some selection for only specific values or pre-aggregation)? You can run SQL code on the DB side out of SAS and then only download the result set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really need the full table then something like a bulkunload will likely perform much better. Downloading the full table will also require the necessary disk space to be available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;is also hinting at other a bit more advanced options like Oracle partitions that - if the Oracle table is created this way - would allow to directly address the partitions and download in "chunks". ...but first look into processing on the Oracle side to reduce volumes prior to loading anything into SAS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Dec 2021 00:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Datasets-from-a-parent-dataset/m-p/784041#M250122</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-12-04T00:22:43Z</dc:date>
    </item>
  </channel>
</rss>

