<?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: Splitting dataset dynamically using macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407507#M99321</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124038"&gt;@MadQuant&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;If your'e using SAS Studio and timeout is the actual issue then read this post (all of it, not only the solution).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Studio/SAS-Studio-Time-out/td-p/257411&amp;nbsp;" target="_blank"&gt;https://communities.sas.com/t5/SAS-Studio/SAS-Studio-Time-out/td-p/257411&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With SAS EG (not sure about SAS Studio) there is also a keepalive parameter which prevents network timeouts.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Administration-and-Deployment/How-Where-do-I-set-the-keepalive-parameter-to-prevent-network/td-p/235250" target="_blank"&gt;https://communities.sas.com/t5/Administration-and-Deployment/How-Where-do-I-set-the-keepalive-parameter-to-prevent-network/td-p/235250&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2017 00:00:13 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2017-10-26T00:00:13Z</dc:date>
    <item>
      <title>Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406791#M99096</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS.&lt;/P&gt;&lt;P&gt;My sample data looks like below. (I couldn't figure out the data step to re-create the sample data, so refer to the screenshot please)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data testdata;&lt;BR /&gt;infile datalines dsd;&lt;BR /&gt;input DATE TIME_M EX SYM_ROOT SYM_SUFFIX TR_SCOND SIZE PRICE TR_STOPIND TR_CORR TR_SEQNUM TR_SOURCE TR_RF ;&lt;BR /&gt;datalines;&lt;BR /&gt;20141224, 9:30:01.006, N, A, , O ,11203, 41.4200, N, 00, 1112, C,&lt;BR /&gt;20141224, 9:30:02.844, N, A, , I , 17, 41.4300, N, 00, 1564, C,&lt;BR /&gt;20141224, 9:30:05.418, D, A, , @ ,100, 41.4300, N, 00, 1770, C, T&lt;BR /&gt;20141224, 9:30:05.419, D, A, , @ ,100, 41.4100, N, 00, 1771, C, T&lt;BR /&gt;20141224, 9:30:05.424, D, A, , @ ,100, 41.4100, N, 00, 1772, C, T&lt;BR /&gt;20141224, 9:30:05.449, D, A, , @ ,100, 41.4200, N, 00, 1780, C, T&lt;BR /&gt;20141224, 9:30:05.565, D, A, , @ ,100, 41.4100, N, 00, 1794, C, T&lt;BR /&gt;20141224, 9:30:12.057, N, A, , FI, 4, 41.5000, N, 00, 2148, C,&lt;BR /&gt;20141224, 9:30:14.066, D, A, , I , 33, 41.4201, N, 00, 2202, C, T&lt;BR /&gt;20141224, 9:30:37.812, N, A, , FI, 37, 41.5000, N, 00, 3019, C,&lt;BR /&gt;20141224, 9:31:00.744, T, A, , @ ,100, 41.5000, N, 00, 3900, C,&lt;BR /&gt;20141224, 9:31:00.744, T, A, , @ ,100, 41.5000, N, 00, 3901, C,&lt;BR /&gt;20141224, 9:31:00.744, T, A, , Q ,100, 41.5000, N, 00, 3902, C,&lt;BR /&gt;20141224, 9:31:00.744, K, A, , F ,100, 41.5000, N, 00, 3903, C,&lt;BR /&gt;20141224, 9:31:00.744, Z, A, , F ,100, 41.5000, N, 00, 3904, C,&lt;BR /&gt;20141224, 9:31:00.809, T, A, , FI, 15, 41.5300, N, 00, 3905, C,&lt;BR /&gt;20141224, 9:31:00.853, D, A, , @ ,100, 41.5000, N, 00, 3908, C, T&lt;BR /&gt;20141224, 9:31:41.154, P, A, , Q ,150, 41.5250, N, 00, 6211, C,&lt;BR /&gt;20141224, 9:31:41.154, P, A, , O ,150, 41.5250, N, 00, 6212, C,&lt;BR /&gt;20141224, 9:31:41.154, P, A, , F ,150, 41.5250, N, 00, 6213, C,&lt;BR /&gt;20141224, 9:31:41.154, T, A, , F ,100, 41.5200, N, 00, 6214, C,&lt;BR /&gt;20141224, 9:31:41.154, T, A, , FI, 50, 41.5200, N, 00, 6215, C,&lt;BR /&gt;20141224, 9:31:41.155, T, A, , FI, 50, 41.5200, N, 00, 6216, C,&lt;BR /&gt;20141224, 9:31:41.155, P, A, , F ,100, 41.5200, N, 00, 6217, C,&lt;BR /&gt;20141224, 9:31:41.155, T, A, , FI, 37, 41.5200, N, 00, 6218, C,&lt;BR /&gt;20141224, 9:31:41.155, K, A, , F ,100, 41.5200, N, 00, 6219, C,&lt;BR /&gt;20141224, 9:31:41.155, P, A, , F ,100, 41.5200, N, 00, 6220, C,&lt;BR /&gt;20141224, 9:31:41.155, P, A, , FI, 50, 41.5200, N, 00, 6221, C,&lt;BR /&gt;20141224, 9:31:41.155, P, A, , FI, 50, 41.5200, N, 00, 6222, C,&lt;BR /&gt;20141224, 9:31:41.155, T, A, , I , 63, 41.5200, N, 00, 6223, C,&lt;BR /&gt;20141224, 9:31:41.155, T, A, , @ ,137, 41.5200, N, 00, 6224, C,&lt;BR /&gt;20141224, 9:31:41.155, T, A, , FI, 78, 41.5200, N, 00, 6225, C,&lt;BR /&gt;20141224, 9:31:41.155, P, A, , @ ,100, 41.5100, N, 00, 6226, C,&lt;BR /&gt;20141224, 9:31:41.155, P, A, , @ ,100, 41.5100, N, 00, 6227, C,&lt;BR /&gt;20141224, 9:31:41.155, P, A, , @ ,100, 41.5100, N, 00, 6228, C,&lt;BR /&gt;20141224, 9:31:41.156, K, A, , F ,100, 41.5100, N, 00, 6229, C,&lt;BR /&gt;20141224, 9:31:41.156, T, A, , F ,100, 41.5100, N, 00, 6230, C,&lt;BR /&gt;20141224, 9:31:41.156, P, A, , FI, 22, 41.5000, N, 00, 6231, C,&lt;BR /&gt;20141224, 9:31:41.157, K, A, , FI, 22, 41.5000, N, 00, 6232, C,&lt;BR /&gt;20141224, 9:31:41.158, P, A, , FI, 78, 41.5000, N, 00, 6233, C,&lt;BR /&gt;20141224, 9:31:41.158, P, A, , F ,100, 41.5000, N, 00, 6234, C,&lt;BR /&gt;20141224, 9:31:41.158, T, A, , @ ,100, 41.5000, N, 00, 6235, C,&lt;BR /&gt;20141224, 9:31:41.158, T, A, , @ ,100, 41.5000, N, 00, 6236, C,&lt;BR /&gt;20141224, 9:31:41.158, T, A, , F ,100, 41.5000, N, 00, 6237, C,&lt;BR /&gt;20141224, 9:31:41.158, K, A, , FI, 78, 41.5000, N, 00, 6238, C,&lt;BR /&gt;20141224, 9:31:41.158, K, A, , F ,100, 41.5000, N, 00, 6239, C,&lt;BR /&gt;20141224, 9:31:41.201, D, A, , @ ,100, 41.5000, N, 00, 6240, C, T&lt;BR /&gt;20141224, 9:31:41.229, P, A, , F ,100, 41.4800, N, 00, 6242, C,&lt;BR /&gt;20141224, 9:31:41.231, N, A, , F ,100, 41.4600, N, 00, 6244, C,&lt;BR /&gt;20141224, 9:31:41.231, T, A, , F ,100, 41.4700, N, 00, 6245, C,&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Trade data" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16168iA7209F4E73AE5EC1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Trade data" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Trade data&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is part of WRDS TAQ (Trade and Qoute) data. The entire data set is enormous. For each day, the number of obs is of order of 10 million. So, even working on WRDS cloud server, which is presumably much faster than my local machine, splitting the dataset is mandatory to do any kind of analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am planning to split the dataset in 40 smaller datasets by ticker symbols of stocks which are SYM_ROOT in this data set.&lt;/P&gt;&lt;P&gt;Now I have a master file for each day that contains distinct SYM_ROOT values. Please see below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test_master;&lt;BR /&gt;infile datalines dsd;&lt;BR /&gt;input DATE CUSIP SYMBOL_ROOT SYMBOL_SUFFIX LISTED_MARKET TAPE SEC_DESC;&lt;BR /&gt;datalines;&lt;BR /&gt;DATE CUSIP SYMBOL_ROOT SYMBOL_SUFFIX LISTED_MARKET TAPE SEC_DESC&lt;BR /&gt;20141224, 00846U101, A , , N, A, AGILENT TECHNOLOGIES INC.&lt;BR /&gt;20141224, 013817101, AA , , N, A, ALCOA INC&lt;BR /&gt;20141224, 013817200, AA , PR , A, B, ALCOA INC. $3.75 PREFERRED STOCK&lt;BR /&gt;20141224, 013817309, AA , PRB, N, A, ALCOA INC.&lt;BR /&gt;20141224, 000307108, AAC , , N, A, AAC HOLDINGS INC.&lt;BR /&gt;20141224, 00768Y206, AADR, , P, B, WCM / BNY MELLON FOCUSED GROWTH ADR ETF&lt;BR /&gt;20141224, 46429B374, AAIT, , T, C, ISHARES MSCI ALL COUNTRY ASIA INFORMATION TECHNOLOGY ETF&lt;BR /&gt;20141224, 02376R102, AAL , , T, C, AMERICAN AIRLINES GROUP INC.&lt;BR /&gt;20141224, 02153X108, AAMC, , A, B, ALTISOURCE ASSET MGMT CORP&lt;BR /&gt;20141224, 048209100, AAME, , T, C, ATLANTIC AMERICAN CORP&lt;BR /&gt;20141224, 002535300, AAN , , N, A, AARON'S INC.&lt;BR /&gt;20141224, 03823U102, AAOI, , T, C, APPLIED OPTOELECTRONICS INC.&lt;BR /&gt;20141224, 000360206, AAON, , T, C, AAON INC&lt;BR /&gt;20141224, 00751Y106, AAP , , N, A, ADVANCE AUTO PARTS INC&lt;BR /&gt;20141224, 037833100, AAPL, , T, C, APPLE INC.&lt;BR /&gt;20141224, 024013104, AAT , , N, A, AMERICAN ASSETS TRUST INC.&lt;BR /&gt;20141224, 020283107, AAU , , A, B, ALMADEN MINERALS LTD.&lt;BR /&gt;20141224, 00765F101, AAV , , N, A, ADVANTAGE OIL &amp;amp; GAS LTD.&lt;BR /&gt;20141224, 05337G107, AAVL, , T, C, AVALANCHE BIOTECHNOLOGIES, INC&lt;BR /&gt;20141224, 049164205, AAWW, , T, C, ATLAS AIR WORLDWIDE HOLDINGS INC.&lt;BR /&gt;20141224, 464288182, AAXJ, , T, C, ISHARES MSCI ALL COUNTRY ASIA EX JAPAN ETF&lt;BR /&gt;20141224, 01881G106, AB , , N, A, ALLIANCEBERNSTEIN HOLDING L.P.&lt;BR /&gt;20141224, G0404E104, ABAC, , T, C, AOXIN TIANLI GROUP INC.&lt;BR /&gt;20141224, 002567105, ABAX, , T, C, ABAXIS INC&lt;BR /&gt;20141224, 000375204, ABB , , N, A, ABB LTD.&lt;BR /&gt;20141224, 00287Y109, ABBV, , N, A, ABBVIE INC.&lt;BR /&gt;20141224, 03073E105, ABC , , N, A, AMERISOURCEBERGEN CORP.&lt;BR /&gt;20141224, 03076K108, ABCB, , T, C, AMERIS BANCORP&lt;BR /&gt;20141224, 13201A107, ABCD, , T, C, CAMBIUM LEARNING GROUP INC.&lt;BR /&gt;20141224, 00762W107, ABCO, , T, C, ADVISORY BOARD CO/THE&lt;BR /&gt;20141224, 03283P106, ABCW, , T, C, ANCHOR BANCORP WISCONSIN INC&lt;BR /&gt;20141224, 01374T102, ABDC, , T, C, ALCENTRA CAPITAL CORP&lt;BR /&gt;20141224, 02319V103, ABEV, , N, A, AMBEV S.A.&lt;BR /&gt;20141224, 043436104, ABG , , N, A, ASBURY AUTO GROUP AB ADS&lt;BR /&gt;20141224, 00289R201, ABGB, , T, C, ABENGOA, S.A. AMERICAN DEPOSITARY SHARES&lt;BR /&gt;20141224, 00211Y209, ABIO, , T, C, ARCA BIOPHARMA INC.&lt;BR /&gt;20141224, 000957100, ABM , , N, A, ABM INDUSTRIES INC.&lt;BR /&gt;20141224, 003654100, ABMD, , T, C, ABIOMED INC&lt;BR /&gt;20141224, 038923108, ABR , , N, A, ARBOR REALTY TRUST INC.&lt;BR /&gt;20141224, 038923603, ABR , PRA, N, A, ARBOR REALTY TRUST INC.&lt;BR /&gt;20141224, 038923702, ABR , PRB, N, A, ARBOR REALTY TRUST INC.&lt;BR /&gt;20141224, 038923801, ABR , PRC, N, A, ARBOR REALTY TRUST INC.&lt;BR /&gt;20141224, 038923884, ABRN, , N, A, ARBOR REALTY TRUST INC&lt;BR /&gt;20141224, 002824100, ABT , , N, A, ABBOTT LABORATORIES&lt;BR /&gt;20141224, 05275N205, ABTL, , T, C, AUTOBYTEL INC&lt;BR /&gt;20141224, 067901108, ABX , , N, A, BARRICK GOLD CORP.&lt;BR /&gt;20141224, G00349103, ABY , , T, C, ABENGOA YIELD PLC&lt;BR /&gt;20141224, 004225108, ACAD, , T, C, ACADIA PHARMACEUTICALS INC.&lt;BR /&gt;20141224, 02503Y103, ACAS, , T, C, AMERICAN CAPITAL LTD&lt;BR /&gt;20141224, 039670104, ACAT, , T, C, ARCTIC CAT INC&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Master" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16169i22D7B3F1D61963FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Master" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Master&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my plan is as follows.&lt;/P&gt;&lt;P&gt;1. Get total number of SYM_ROOT variable from the master and then group into 40 mutually exclusive groups.&lt;/P&gt;&lt;P&gt;2. Based on&amp;nbsp;those groups, implement analysis on the Trade (and Quote) data, 40 times.&lt;/P&gt;&lt;P&gt;3. Then, combine those results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is apparently the&amp;nbsp;1st step. I am only this far... Oh, and I did not know how to split in 40 groups, so I just tried to use arbitrary cutoff=100 to make the groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select count(SYMBOL_ROOT)&lt;BR /&gt;into :N_STOCK&lt;BR /&gt;from&amp;nbsp;test_master&lt;BR /&gt;where LISTED_MARKET in ('A' 'N' 'T' 'Q') /* AMEX, NYSE, NASDAQ */&lt;BR /&gt;and TAPE = 'A' /* Common stock */&lt;BR /&gt;; quit;&lt;/P&gt;&lt;P&gt;%let CUTOFF = 100;&lt;BR /&gt;%let N_GROUP = %sysfunc(ceil(&amp;amp;N_stock/&amp;amp;CUTOFF));&lt;BR /&gt;%let i=1;&lt;BR /&gt;%macro Test;&lt;BR /&gt;%do i=1 %to &amp;amp;N_GROUP;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select SYMBOL_ROOT&lt;BR /&gt;into :STOCKLIST&amp;amp;i&lt;BR /&gt;separated by '" "'&lt;BR /&gt;from test_master&lt;BR /&gt;where LISTED_MARKET in ('A' 'N' 'T' 'Q') /* AMEX, NYSE, NASDAQ */&lt;BR /&gt;and TAPE = 'A' /* Common stock */&lt;BR /&gt;and monotonic() between &amp;amp;cutoff*(&amp;amp;i-1)+1 and &amp;amp;cutoff*&amp;amp;i&lt;BR /&gt;; quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend Test;&lt;BR /&gt;%Test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use SAS 9.4 / Windows 10 Version 6.2.9200.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any inputs or comments are appreciated. I'd be truly grateful for any feedbacks.&lt;/P&gt;&lt;P&gt;If any of you think you need more details on the data to help me, please let me know.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 04:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406791#M99096</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-24T04:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406799#M99100</link>
      <description>&lt;P&gt;I would not create new datasets. Copying data is very wasteful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you must analyse a subset, just point to the original data set with a where clause.&lt;/P&gt;
&lt;P&gt;I suspect you may not even need to do that, depending on the analysis, and a class statement might even do the job, allowing you to process the data set in one pass.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do start copying data around, and if this is a SAS data set, use this data shuffling cost to recreate the dataset in a sorted order, and maybe indexed. Subsequent accesses of subsets will be much faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you must create data subsets, I strongly suggest that you create a SPDE library&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SPEEDY spde "%sysfunc(pathname(WORK))" compress=binary;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and that you use this as your work library.&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>Tue, 24 Oct 2017 05:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406799#M99100</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-10-24T05:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406800#M99101</link>
      <description>&lt;P&gt;I have created a macro to split data. It takes symbol root as an input and creates dataset with name as "Data_AA". Here AA is your symbol root. It will create separate dataset for every symbol root.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have assume column name as SYMBOL_ROOT in testdata.&amp;nbsp;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro split_data(_sym_root);
%put symroot val = &amp;amp;_sym_root;
proc sql;
create table Data_&amp;amp;_sym_root. as
select *
from testdata
where SYM_ROOT ="&amp;amp;_sym_root";
quit;

%mend;
filename Split temp;
data _null_;
set  test_master;
file split;
put "%" "split_data(" SYMBOL_ROOT ");";
run;
%inc Split;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just for your knowledge Split file would have call to the macro something like this.&lt;/P&gt;
&lt;DIV class="sasSource"&gt;%split_data(A );&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;%split_data(C );&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;%split_data(B );&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;You can&amp;nbsp;add your analysis in %split macro or may be you may need to create separate macro with same kind of approach.&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Oct 2017 05:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406800#M99101</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2017-10-24T05:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406957#M99148</link>
      <description>&lt;P&gt;Spend some time researching BY group processing, otherwise the rest of your project will end up as macros to process each of your smaller data set. I believe the WRDS server is well powered to handle these large data sets - it's designed specifically for that after all.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 14:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/406957#M99148</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-24T14:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407008#M99151</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124038"&gt;@MadQuant&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What analysis are you trying to do with the trade data?&amp;nbsp;&amp;nbsp; Which is another way of asking whether you really need to make intermediate data sets.&amp;nbsp; Or if you do need to make intermediates, you should be sure to create any new variables at the same time.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;What is the purpose of the subgroups?&amp;nbsp; Is it to manage data set size, or is it for analysis purposes?&amp;nbsp; It appears to be a data set size issue, since your are not using any particular criterion to specify your groups.&amp;nbsp; I ask this because there may not be any particular reason to divide the data sets.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;How are your 40 portfolios being constructed.&amp;nbsp; Are they simply divided alphabetically by SYM_ROOT/SYM_SUFFIX?&amp;nbsp;&amp;nbsp; If so you might be able to use BY-group processing in the analysis - alleviating the need to run the analysis 40 times.&amp;nbsp; Instead one analysis will be run iteratively over 40 by-groups.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;I would NOT, repeat NOT, use proc sql (for constructing the 40 subgroups)&amp;nbsp;if you care about the time-ordering of trades within stocks.&amp;nbsp;&amp;nbsp;PROC SQL does not guarantee preservation of record order (the incoming TAQ data are sorted by SYM_ROOT/SYM_SUFFIX/time).&amp;nbsp; And yes, you could put an ORDER BY expression in proc sql, but it will require at least one extra unnecessary pass through the data.&amp;nbsp; Instead you should be using a DATA step.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So please provide a more complete description of your research task.&amp;nbsp; I'm sure we can come up with a relatively efficient solution.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 16:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407008#M99151</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-24T16:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407019#M99153</link>
      <description>&lt;P&gt;Thank you for the comment.&lt;/P&gt;&lt;P&gt;Upon reading your comment, now I see I have not written my point clearly.&lt;/P&gt;&lt;P&gt;So my goal is to do the same analyses on a huge dataset(A) separately for subsets of that dataset(A), due to the size and capacity.&lt;/P&gt;&lt;P&gt;I tried to the analysis on the whole dataset(A), but the WRDS server disconnected me after couple of hours, and I heard that I have to do it separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 17:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407019#M99153</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-24T17:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407021#M99154</link>
      <description>Thank you for the comment.&lt;BR /&gt;I tried to the analysis on the whole dataset, but the WRDS server disconnected me after couple of hours, and I heard that I have to do it separately.&lt;BR /&gt;So that's why I am trying this way.&lt;BR /&gt;I will try to see if BY grouping works.</description>
      <pubDate>Tue, 24 Oct 2017 17:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407021#M99154</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-24T17:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407023#M99155</link>
      <description>&lt;P&gt;Thank you for the comment.&lt;BR /&gt;So my goal is to do the&amp;nbsp;one (or more)&amp;nbsp;analysis (e.g. calculate orderflows and so on) on a huge dataset(A). I tried to the&amp;nbsp;calculation on the whole dataset(A), but the WRDS server disconnected me after couple of hours, and I heard that I have to do it separately. Also, the space assigned to individuals on the cloud&amp;nbsp;is only a few hundered megas or at most a few gigas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to put SYM_ROOT variables separately in the WHERE clause of the main analysis code, which I posted below. The order or dividing method doesn't really matter as long as it covers the whole data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    data DailyTrade;

        /* Enter Trade file names in YYYYMMDD format for the same dates */
        set ct.ctm_20141224;

		/* Enter the same company tickers as above */
        where /* sym_root in ('AAPL','IBM') and */

        /* Retrieve trades during normal market hours */
        (("9:30:00.000000000"t) &amp;lt;= time_m &amp;lt;= ("16:00:00.000000000"t));
        type='T';
        format date date9.;
        format time_m part_time trf_time TIME20.9;
    run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the comment on PROC SQL. I wasn't aware of that.&lt;/P&gt;&lt;P&gt;I am relatively more familiar to SQL so that is the reason I was using it...&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 17:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407023#M99155</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-24T17:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407040#M99156</link>
      <description>&lt;P&gt;TAQ doesn't have order-book data, so I assume that by "order flows" you mean trade-volume over rolling windows of some time length.&amp;nbsp; Is this correct?&amp;nbsp; If so,&amp;nbsp;there is no need to make intermediate data sets with all trades for a subset of stock symbols.&amp;nbsp; One can read in all the CT data, and create (say) 1-minute or 5-minute trade volume values, creating a much smaller data set that the original CTM datasets (which currently time-stamps to the nano-second, although the 2014 data might be millisecond or microsecond).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding being cut off from WRDS:&amp;nbsp;&amp;nbsp;I take it that you are using pc sas/connect to run you program on WRDS.&amp;nbsp; If you are getting disconnected, it's probably because some network monitor between WRDS and your PC (probably your school) detects no network traffic in your connection.&amp;nbsp; That monitor likely&amp;nbsp;decided you've abandoned the session and disconnects your machine from WRDS.&amp;nbsp; If you're using a machine on your campus network, I'd suggest contacting your network support folks to see about a work-around.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, (assuming again you are using pc sas/connect) if you have multiple DATA steps and PROC steps between an RSUBMIT and ENDRSUBMIT, then block each single step with RSUBMIT/ENDRSUBMIT.&amp;nbsp; This will cause more frequent traffic on your sas log (proving you haven't abandoned the connections).&amp;nbsp; And you can select all the rsubmit/endrsubmit blocks for simultaneous submission, so no additional baby sitting is required vs a single multi-step rsubmit/endrsubmit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If none of this work to keep you connected, consider using sas/studio on WRDS.&amp;nbsp; Perhaps your network monitor will not apply the same criteria for disconnection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 19:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407040#M99156</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-24T19:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407060#M99161</link>
      <description>&lt;P&gt;For order flows, they are net of buy and sell trading volume, so the first step is to identify the sign (plus or minus) of each trade, which is not offered by TAQ. So at least once, I have to do some kind of manipulations at each trade level to assign the signs. So I think that gets back to applying subset of stock symbols right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding being cut off from WRDS, you are correct. Wrapping with RSUBMIT/ENDRSUBMIT seems to be a&amp;nbsp;nice idea.&amp;nbsp;Also, I did not know that SAS/Studio has different criteria for this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your time.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 20:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407060#M99161</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-24T20:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407110#M99182</link>
      <description>&lt;P&gt;What criteria will you be using to mark a trade as&amp;nbsp;a buyer-driven or seller-driven transaction?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am aware that one can interleave the quotes file with the trade file, then compare the trade price to some lagged (by&amp;nbsp;a short time interval) BID and ASK prices from the corresponding quotes file.&amp;nbsp; You should note that the quotes file is a lot larger than the trades file, a gift of high frequency trading techniques.&amp;nbsp; In the case of 20141224, there are 245 million trades, and about 19.7 billion quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or do you intend to assign buy/sell trades based solely on rolling micro-series of trade prices?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless, &amp;nbsp;I suggest you make a sample of, say, 50 stocks, and then develop your entire sequence of operations.&amp;nbsp; I mean, after you assign buy/sell designations, then what will you be doing?&amp;nbsp; Aggregating over time periods?&amp;nbsp;&amp;nbsp; I raise this issue because you can do a sequence of operations in a single DATA step, possibly yielding a much smaller working data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can start worrying about whether and how to divide a large data set.&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;
&lt;P&gt;You should just take a sample of, say, 100 stocks, and develop a program t&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with TAQ data is to use the trade file in conjunction with the same-day quote file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can not mark trades as buys&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 23:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407110#M99182</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-24T23:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407494#M99315</link>
      <description>&lt;P&gt;Thanks again for your interest.&lt;/P&gt;&lt;P&gt;I am using Lee and Ready (1991), which is common in academia. The basic idea is that if the trade price is larger (smaller) than the midpoint of bid-ask quote, then it is classified as buy (sell) initiated trade.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, yes, I also need quote data to do this. WRDS offers NBBO (National Best Bid and Offer) data, which also needs to be complemented by quote data, to do this. If you are interested in the details, please look at the link below.&lt;/P&gt;&lt;P&gt;&lt;A title="Holden and Jacobsen TAQ Code" href="http://www.excelmodeling.com/Holden-and-Jacobsen-Daily-TAQ-and-Monthly-TAQ-Code-2017-01-02.zip" target="_blank"&gt;http://www.excelmodeling.com/Holden-and-Jacobsen-Daily-TAQ-and-Monthly-TAQ-Code-2017-01-02.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, the code&amp;nbsp;for this&amp;nbsp;job is already there, although some customizing is required.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The biggest problem is implementing this wisely so that WRDS server does not cut me off and individual cloud storage size issue when the result comes out. That's why I am focusing on doing the job&amp;nbsp;on 40-ish subsets and then aggregating later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, my conclusion is to use splitted&amp;nbsp;SYM_ROOT to run the same code multiple times.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 22:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407494#M99315</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-25T22:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407507#M99321</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/124038"&gt;@MadQuant&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;If your'e using SAS Studio and timeout is the actual issue then read this post (all of it, not only the solution).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Studio/SAS-Studio-Time-out/td-p/257411&amp;nbsp;" target="_blank"&gt;https://communities.sas.com/t5/SAS-Studio/SAS-Studio-Time-out/td-p/257411&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With SAS EG (not sure about SAS Studio) there is also a keepalive parameter which prevents network timeouts.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Administration-and-Deployment/How-Where-do-I-set-the-keepalive-parameter-to-prevent-network/td-p/235250" target="_blank"&gt;https://communities.sas.com/t5/Administration-and-Deployment/How-Where-do-I-set-the-keepalive-parameter-to-prevent-network/td-p/235250&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 00:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407507#M99321</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-26T00:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407536#M99331</link>
      <description>&lt;P&gt;To create the 40 datasets you want, you'll have to read the whole big date 40 times. And then write the data. And that's before you do any analysis. Unless&amp;nbsp;your analysis requires sorted data, you may not want to do this (and if it does see my previous point and use SPDE).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead just run the analysis on the whole dataset using a where clause.&amp;nbsp;A very simple (and perhaps sufficient) way to do this would be to take the first letter of&amp;nbsp;&lt;SPAN&gt;SYM_ROOT.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;where&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SYM_ROOT=:'A'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;where&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SYM_ROOT=:'B'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;etc&lt;/P&gt;
&lt;P&gt;to get 26 subsets of varying sizes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This way, an index on&amp;nbsp;&lt;SPAN&gt;SYM_ROOT, if there is one,&amp;nbsp;can be used for small subsets.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note that&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;where&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SYM_ROOT =: 'A'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;where&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SYM_ROOT like 'A%'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;can use indexes but&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;where first(&lt;/SPAN&gt;&lt;SPAN&gt;SYM_ROOT)='A'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;can't.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 04:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/407536#M99331</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-10-26T04:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408017#M99495</link>
      <description>I am using Base SAS, but if using SAS Studio helps, I would look into it. Thanks.</description>
      <pubDate>Fri, 27 Oct 2017 13:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408017#M99495</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-27T13:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408182#M99567</link>
      <description>&lt;P&gt;Ah, this is it!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I should change my question.&lt;/P&gt;&lt;P&gt;How do I assign the 4000-ish SYM_ROOTs dynamically into, say, 40 equal macro variables to use it in WHERE clause?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So instead of using&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;where&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SYM_ROOT=:'A'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;where&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SYM_ROOT=:'B'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which would vary in size, I would like to have equal subset of SYM_ROOT to put it in the WHERE clause of my main analysis code. Each day would be different, so it has to depend on the total number of obs of SYM_ROOT on daily bases.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I searched a few postings but mostly they rely on additional group identifiers. In my case there aren't any.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 21:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408182#M99567</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-27T21:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408184#M99569</link>
      <description>&lt;P&gt;Take the total number of obs, from sashelp.vtable, divide it by 40 and split your dataset into your 40 subsets by the number of records.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to keep the groups together, then consider seeing if you can tweak a PROC SURVEYSELECT to do it for you.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 21:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408184#M99569</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-27T21:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting dataset dynamically using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408187#M99572</link>
      <description>Thanks. I wasn't aware of PROC SURVEYSELECT, but I will look into it.</description>
      <pubDate>Fri, 27 Oct 2017 21:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitting-dataset-dynamically-using-macro/m-p/408187#M99572</guid>
      <dc:creator>MadQuant</dc:creator>
      <dc:date>2017-10-27T21:51:46Z</dc:date>
    </item>
  </channel>
</rss>

