<?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 Dataset By Number of Observations and Place in Macrovariables? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564682#M11097</link>
    <description>&lt;P&gt;Hard to tell without seeing your code. Most likely you accidentally removed the END= option from the SET statement so the CALL SYMPUTX() function that creates that macro variable never runs.&lt;/P&gt;
&lt;P&gt;If not then change the condition for the DO loop to also test the EOF variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;until(eof or length(pmlist)&amp;gt;31000)&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 08 Jun 2019 16:56:55 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-06-08T16:56:55Z</dc:date>
    <item>
      <title>How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564590#M11066</link>
      <description>&lt;P align="left"&gt;I have been stuck on a piece of code for a long time and would appreciate any help I can get? Using SAS enterprise guide. I would like to learn how to split a dataset I have by number of observations for a specific variable. The variable is really long and unique to a product. As the variable is so long I can not simply use a sub set to reference the variable in the next piece of code or use a proc sql to count the variable in to a macro variable. Both would either reach its limit or take far too long to run. The main issue I have is I want this all to be automatically counted and calculated by the sas code(avoid having to manually change the code to create another dataset for new variables or have to state how many smaller datasets it has split the data in to), there are already 29000 of this variable and it will only get bigger, the variable is seriously long (20-30 characters) and I would like the split down datasets to be able to use in macro variable references in the next two pieces of code.&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;EG. I have a dataset with 6000 different product numbers. I want sas to split this variable down by 1500 into smaller datasets. So this would mean it would put the first 1500 into dataset 1, the next 1500 into dataset 2 etc. If the following week another 1500 is added to the dataset, the code would pick this up and split the final 1500 into dataset 5. The smaller datasets would then be used in macro variable for other pieces of code I have. So dataset 1 could be referenced &amp;amp;PN1, dataset 2 &amp;amp;PN2 etc. It would ideally be able to tell how many smaller datasets there are and reference the smaller datasets in a macro variable without having myself manually entering each smaller dataset.&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;example of what I want to achieve. This example does not take in to the account the actual product number I have is really long and there are over 29000 observations.&lt;/P&gt;&lt;P align="left"&gt;Have:&lt;/P&gt;&lt;P align="left"&gt;data work.class;&lt;/P&gt;&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;&lt;P align="left"&gt;1234&lt;/P&gt;&lt;P align="left"&gt;1345&lt;/P&gt;&lt;P align="left"&gt;1347&lt;/P&gt;&lt;P align="left"&gt;1889&lt;/P&gt;&lt;P align="left"&gt;1009&lt;/P&gt;&lt;P align="left"&gt;2234&lt;/P&gt;&lt;P align="left"&gt;;;;;&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;data work.class;&lt;/P&gt;&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;&lt;P align="left"&gt;1234&lt;/P&gt;&lt;P align="left"&gt;1345&lt;/P&gt;&lt;P align="left"&gt;1347&lt;/P&gt;&lt;P align="left"&gt;1889&lt;/P&gt;&lt;P align="left"&gt;1009&lt;/P&gt;&lt;P align="left"&gt;2234&lt;/P&gt;&lt;P align="left"&gt;;;;;&lt;/P&gt;&lt;P align="left"&gt;data work.class;&lt;/P&gt;&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;&lt;P align="left"&gt;1234&lt;/P&gt;&lt;P align="left"&gt;1345&lt;/P&gt;&lt;P align="left"&gt;1347&lt;/P&gt;&lt;P align="left"&gt;1889&lt;/P&gt;&lt;P align="left"&gt;1009&lt;/P&gt;&lt;P align="left"&gt;2234&lt;/P&gt;&lt;P align="left"&gt;;;;;&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;data work.class;&lt;/P&gt;&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;&lt;P align="left"&gt;1234&lt;/P&gt;&lt;P align="left"&gt;1345&lt;/P&gt;&lt;P align="left"&gt;1347&lt;/P&gt;&lt;P align="left"&gt;1889&lt;/P&gt;&lt;P align="left"&gt;1009&lt;/P&gt;&lt;P align="left"&gt;2234&lt;/P&gt;&lt;P align="left"&gt;　;;;;&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;Want&lt;/P&gt;&lt;P align="left"&gt;The above split by 2 observations and be put into macrovariables to be used.&lt;/P&gt;&lt;P align="left"&gt;1234 and 1345 into &amp;amp;PM1&lt;/P&gt;&lt;P align="left"&gt;1347 and 1889 into &amp;amp;PM2&lt;/P&gt;&lt;P align="left"&gt;1009 and 2234 into &amp;amp;PM3&lt;/P&gt;&lt;P align="left"&gt;If the following week there are two more added then it will automatically pick this up and put them into &amp;amp;PM4.　&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;If the next piece of code was :&lt;/P&gt;&lt;P align="left"&gt;proc sql;&lt;/P&gt;&lt;P align="left"&gt;select *　&lt;/P&gt;&lt;P align="left"&gt;from madeupset&lt;/P&gt;&lt;P align="left"&gt;where product number in ( &amp;amp;PM1, &amp;amp;PM2, &amp;amp;PM3, &amp;amp;PM4)&lt;/P&gt;&lt;P align="left"&gt;;quit;&lt;/P&gt;&lt;P align="left"&gt;　Would there be a way of referencing those smaller datasets without having to manually enter them when they are created?&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;Apologies if this is confusing. It is my first post and I will be very happy to provide anything else needed.&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P align="left"&gt;Thanks!&lt;/P&gt;&lt;P align="left"&gt;JackoNewbie&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 22:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564590#M11066</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-07T22:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564592#M11067</link>
      <description>&lt;P&gt;Are you doing this for a SQL Pass through query? If so there are better ways, a macro for example that automatically creates that list on the fly so you don't run into any issues with macro variable size. Or using a subquery depending if the data is in the same warehouse.&lt;BR /&gt;&lt;BR /&gt;where product_number in (Select ID from pm)&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;LI-SPOILER&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277136"&gt;@JackoNewbie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P align="left"&gt;I have been stuck on a piece of code for a long time and would appreciate any help I can get? Using SAS enterprise guide. I would like to learn how to split a dataset I have by number of observations for a specific variable. The variable is really long and unique to a product. As the variable is so long I can not simply use a sub set to reference the variable in the next piece of code or use a proc sql to count the variable in to a macro variable. Both would either reach its limit or take far too long to run. The main issue I have is I want this all to be automatically counted and calculated by the sas code(avoid having to manually change the code to create another dataset for new variables or have to state how many smaller datasets it has split the data in to), there are already 29000 of this variable and it will only get bigger, the variable is seriously long (20-30 characters) and I would like the split down datasets to be able to use in macro variable references in the next two pieces of code.&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;EG. I have a dataset with 6000 different product numbers. I want sas to split this variable down by 1500 into smaller datasets. So this would mean it would put the first 1500 into dataset 1, the next 1500 into dataset 2 etc. If the following week another 1500 is added to the dataset, the code would pick this up and split the final 1500 into dataset 5. The smaller datasets would then be used in macro variable for other pieces of code I have. So dataset 1 could be referenced &amp;amp;PN1, dataset 2 &amp;amp;PN2 etc. It would ideally be able to tell how many smaller datasets there are and reference the smaller datasets in a macro variable without having myself manually entering each smaller dataset.&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;example of what I want to achieve. This example does not take in to the account the actual product number I have is really long and there are over 29000 observations.&lt;/P&gt;
&lt;P align="left"&gt;Have:&lt;/P&gt;
&lt;P align="left"&gt;data work.class;&lt;/P&gt;
&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;
&lt;P align="left"&gt;1234&lt;/P&gt;
&lt;P align="left"&gt;1345&lt;/P&gt;
&lt;P align="left"&gt;1347&lt;/P&gt;
&lt;P align="left"&gt;1889&lt;/P&gt;
&lt;P align="left"&gt;1009&lt;/P&gt;
&lt;P align="left"&gt;2234&lt;/P&gt;
&lt;P align="left"&gt;;;;;&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;data work.class;&lt;/P&gt;
&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;
&lt;P align="left"&gt;1234&lt;/P&gt;
&lt;P align="left"&gt;1345&lt;/P&gt;
&lt;P align="left"&gt;1347&lt;/P&gt;
&lt;P align="left"&gt;1889&lt;/P&gt;
&lt;P align="left"&gt;1009&lt;/P&gt;
&lt;P align="left"&gt;2234&lt;/P&gt;
&lt;P align="left"&gt;;;;;&lt;/P&gt;
&lt;P align="left"&gt;data work.class;&lt;/P&gt;
&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;
&lt;P align="left"&gt;1234&lt;/P&gt;
&lt;P align="left"&gt;1345&lt;/P&gt;
&lt;P align="left"&gt;1347&lt;/P&gt;
&lt;P align="left"&gt;1889&lt;/P&gt;
&lt;P align="left"&gt;1009&lt;/P&gt;
&lt;P align="left"&gt;2234&lt;/P&gt;
&lt;P align="left"&gt;;;;;&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;data work.class;&lt;/P&gt;
&lt;P align="left"&gt;input ProductNumber:32.;&lt;/P&gt;
&lt;P align="left"&gt;1234&lt;/P&gt;
&lt;P align="left"&gt;1345&lt;/P&gt;
&lt;P align="left"&gt;1347&lt;/P&gt;
&lt;P align="left"&gt;1889&lt;/P&gt;
&lt;P align="left"&gt;1009&lt;/P&gt;
&lt;P align="left"&gt;2234&lt;/P&gt;
&lt;P align="left"&gt;　;;;;&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;Want&lt;/P&gt;
&lt;P align="left"&gt;The above split by 2 observations and be put into macrovariables to be used.&lt;/P&gt;
&lt;P align="left"&gt;1234 and 1345 into &amp;amp;PM1&lt;/P&gt;
&lt;P align="left"&gt;1347 and 1889 into &amp;amp;PM2&lt;/P&gt;
&lt;P align="left"&gt;1009 and 2234 into &amp;amp;PM3&lt;/P&gt;
&lt;P align="left"&gt;If the following week there are two more added then it will automatically pick this up and put them into &amp;amp;PM4.　&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;If the next piece of code was :&lt;/P&gt;
&lt;P align="left"&gt;proc sql;&lt;/P&gt;
&lt;P align="left"&gt;select *　&lt;/P&gt;
&lt;P align="left"&gt;from madeupset&lt;/P&gt;
&lt;P align="left"&gt;where product number in ( &amp;amp;PM1, &amp;amp;PM2, &amp;amp;PM3, &amp;amp;PM4)&lt;/P&gt;
&lt;P align="left"&gt;;quit;&lt;/P&gt;
&lt;P align="left"&gt;　Would there be a way of referencing those smaller datasets without having to manually enter them when they are created?&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;Apologies if this is confusing. It is my first post and I will be very happy to provide anything else needed.&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;P align="left"&gt;Thanks!&lt;/P&gt;
&lt;P align="left"&gt;JackoNewbie&lt;/P&gt;
&lt;P align="left"&gt;　&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 23:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564592#M11067</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-07T23:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564593#M11068</link>
      <description>&lt;P&gt;I can't see anything in your description that actually requires a splitting up of the data, much less to continue to add complexity by creating ever more data sets.&lt;/P&gt;
&lt;P&gt;Without any rule related to the actual VALUES of the variable going to specific sets then to get all records for a single "product" the first thing you would be doing constantly is combining all of the data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally there are two main cases when I consider "splitting data". The first is when I am forced to provide an EXCEL or similar spreadsheet and my data contains more variables or records than can be placed into a single sheet of a spreadsheet.&lt;/P&gt;
&lt;P&gt;The other is when the actual structure/ layout or coding values&amp;nbsp;of a&amp;nbsp;data description changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One tends to suspect there is much left out of your problem discussion and much of it might be addressed if a more complete description is provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By "The variable is really long and unique to a product." do you mean that a single product identifier has &lt;STRONG&gt;multiple&lt;/STRONG&gt; long associated values? Or is there just &lt;STRONG&gt;one&lt;/STRONG&gt; long value. An example of the later is product 1234 has "long value" such as "Widget X for purpose Y" and only that long value. If this is the case then your PRODUCT code already contains all of the information you ever need. You could use the information to create a Format for displaying the "long" value instead of the raw code for most purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure why you say "the variable is seriously long (20-30 characters)". Since the length of a single SAS character variable can go to 32,767 characters that is not particularly long.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 23:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564593#M11068</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-07T23:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564596#M11069</link>
      <description>&lt;P&gt;Hi and welcome to SAS. Can you make your question simpler by giving us the following plz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. A sample data of what you HAVE's (paste here as text for us to copy paste and work with it)&lt;/P&gt;
&lt;P&gt;2. A sample data of what you WANT's(your expected output for the input sample)&lt;/P&gt;
&lt;P&gt;3. A brief explanation of the convert/business logic and that is your objective&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am sure somebody will offer you the coding solution. If i have time, I'll give it a shot!&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 00:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564596#M11069</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-06-08T00:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564638#M11083</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the super quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes it is and I have tried the subquery way but it takes far too long which is why I would like the sets broken down by number. When I do this manually and reference the smaller sets broken down it runs super super quick. I am just trying to find a way for this to be done without having to manually edit the code. I do definitely need a macro of some sort.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 09:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564638#M11083</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-08T09:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564643#M11084</link>
      <description>&lt;P&gt;Thanks Ballard for the reply and apologies again as this is my first post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are correct in my code I am combining the datasets by putting 'where Product_number in (&amp;amp;PM1, &amp;amp;PM2 etc)'. I would like to avoid this manual step of entering the amount of datasets I need to include and possibly use a macro to automatically calculate this itself and use in code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I am doing this is to avoid the lengthy time it takes to complete this by simply doing a sub query. It could reduce the time it takes from an hour to just 5 minutes for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was meaning that the example product 1234 is actually a longer value. Such as 12345678910111213141516171819202122 and there are around 30000 of these value which I need to reference. So this is why I am splitting the dataset into smaller ones as It reaches a limit when I use in a macro variable. I couldn't just use one macro variable list to referent all products as it reaches a limit (can't fit it all in &amp;amp;PM1).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I has a dataset with a list of 30,000 different product_numbers which are the same length as&amp;nbsp;12345678910111213141516171819202122. I would use the below code to split them down and use in a different dataset but this is manual and would like it to be automated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data PM1 PM2 PM3;
if _n_ le 10000 then output PM1;
else if _n_ le 20000 then output PM2;
else if _n_ le 30000 then output PM3;
run;



proc sql noprint;
select quote(strip(product_number,"'") into:PM1 seperated by ', '
from PM1;
quit;
run;
%put PM1 = &amp;amp;PM1

proc sql noprint;
select quote(strip(product_number,"'") into:PM2 seperated by ', '
from PM2;
quit;
run;
%put PM2 = &amp;amp;PM2

proc sql noprint;
select quote(strip(product_number,"'") into:PM3 seperated by ', '
from PM3;
quit;
run;
%put PM3 = &amp;amp;PM3

/*the above would not let me split by 10000 in my real code as splitting by 10000 would exceed the maximum length (65534)

proc sql;
create table getextrainfo as
select *
from tableheldwithextrainfo
where product_number in (&amp;amp;PM1, &amp;amp;PM2, &amp;amp;PM3)
;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I hope this helps. Again I am happy to provide more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 11:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564643#M11084</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-08T11:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564644#M11085</link>
      <description>&lt;P&gt;Hi Novinosrin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the lack of information. Will the above response to another member be enough info?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 11:42:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564644#M11085</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-08T11:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564645#M11086</link>
      <description>&lt;P&gt;additional info -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are correct in my code I am combining the datasets by putting 'where Product_number in (&amp;amp;PM1, &amp;amp;PM2 etc)'. I would like to avoid this manual step of entering the amount of datasets I need to include and possibly use a macro to automatically calculate this itself and use in code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I am doing this is to avoid the lengthy time it takes to complete this by simply doing a sub query. It could reduce the time it takes from an hour to just 5 minutes for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was meaning that the example product 1234 is actually a longer value. Such as 12345678910111213141516171819202122 and there are around 30000 of these value which I need to reference. So this is why I am splitting the dataset into smaller ones as It reaches a limit when I use in a macro variable. I couldn't just use one macro variable list to referent all products as it reaches a limit (can't fit it all in &amp;amp;PM1).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I has a dataset with a list of 30,000 different product_numbers which are the same length as&amp;nbsp;12345678910111213141516171819202122. I would use the below code to split them down and use in a different dataset but this is manual and would like it to be automated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; PM1 PM2 PM3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;le&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10000&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; output PM1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;le&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;20000&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; output PM2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;le&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;30000&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; output PM3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;



&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt; noprint&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;quote&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;strip&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;product_number&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"'"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt;:PM1 seperated &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;', '&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; PM1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token macrostatement"&gt;%put&lt;/SPAN&gt; PM1 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM1

&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt; noprint&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;quote&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;strip&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;product_number&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"'"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt;:PM2 seperated &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;', '&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; PM2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token macrostatement"&gt;%put&lt;/SPAN&gt; PM2 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM2

&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt; noprint&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;quote&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;strip&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;product_number&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"'"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt;:PM3 seperated &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;', '&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; PM3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token macrostatement"&gt;%put&lt;/SPAN&gt; PM3 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM3

&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;the above would &lt;SPAN class="token operator"&gt;not&lt;/SPAN&gt; let me split &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10000&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; my real code as splitting &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10000&lt;/SPAN&gt; would &lt;SPAN class="token number"&gt;ex&lt;/SPAN&gt;ceed the maximum &lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;65534&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
create &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt; getextrainfo as
&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; tableheldwithextrainfo
&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; product_number &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM1&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM2&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM3&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I hope this helps. Again I am happy to provide more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 11:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564645#M11086</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-08T11:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564662#M11093</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277136"&gt;@JackoNewbie&lt;/a&gt;&amp;nbsp; Yes and clear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; PM1 PM2 PM3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;le&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10000&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; output PM1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;le&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;20000&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; output PM2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _n_ &lt;SPAN class="token operator"&gt;le&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;30000&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; output PM3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A very simple automation with a hash solution. But rather than split , can you have PM1-PM3 appended has&lt;STRONG&gt; one stack dataset&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then&amp;nbsp;instead of&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
create &lt;SPAN class="token statement"&gt;table&lt;/SPAN&gt; getextrainfo as
&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; tableheldwithextrainfo
&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt; product_number &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM1&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM2&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;PM3&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could have a direct look up from tableheldwithextrainfo &amp;lt;--&amp;gt;PM1-PM3(&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;one stack dataset)&lt;/STRONG&gt; and result in matches. Is this idea ok?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 14:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564662#M11093</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-06-08T14:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564663#M11094</link>
      <description>&lt;P&gt;You probably need to find another way to do your query since most systems are also going to start complaining if you give them really long lists of constant values.&amp;nbsp; What system are you dataset in? Are they SAS datasets? Are they in a database like Oracle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that there is no need to make datasets with the "split" lists if the goal is to make MACRO variables with the split list.&lt;/P&gt;
&lt;P&gt;For example you could just use dataset options to limit which values go into which macro variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select quote(strip(product_number,"'") 
  into :PM0 seperated by ','
  from PMLIST(firstobs=0001 obs=1000)
;
select quote(strip(product_number,"'") 
  into :PM1 seperated by ','
  from PMLIST(firstobs=1001 obs=2000)
;
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or use CALL SYMPUTX() to make the macro variables in one pass of the list.&lt;/P&gt;
&lt;P&gt;So this datastep will split list of product numbers from a dataset named PMLIST into a series of macro variables named PM1 , PM2, ... and also generate a macro variable named PMLIST that references all of the other generated macro variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length pmlist $32000 mvarlist $32000;
  retain mvarlist;
  mvar+1;
  do until(length(pmlist)&amp;gt;31000);
    set pmlist end=eof;
    pmlist=catx(',',pmlist,quote(trim(product_number),"'"));
  end;
  call symputx(cats('PM',mvar),pmlist);
  mvarlist=catx(',',mvarlist,cats('&amp;amp;PM',mvar));
  if eof then call symputx('pmlist',mvarlist);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then your query is just:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where product_number in (&amp;amp;PMLIST)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Jun 2019 15:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564663#M11094</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-08T15:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564680#M11096</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is super useful to me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The set is in SAS. SAS EG.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this code and it is showing an error when I am trying to run the final query with:&amp;nbsp;&lt;SPAN class="token statement" style="box-sizing: inherit; color: blue; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt; product_number &lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: black; direction: ltr; font-family: Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt;PMLIST&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is that pmlist is not being referenced properly. 'Warning: Apparent symbolic reference PMLIST not resolved.' From the code you sent, the only section I changed was where the dataset was stored. So in the 'SET' section I changed the dataset 'pmlist' to my own dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I refeence &amp;amp;PM1 &amp;amp;PM2 etc it works. Just when it is &amp;amp;PMLIST it does not get referenced properly.&lt;/P&gt;&lt;P&gt;'&lt;SPAN class="token statement" style="box-sizing: inherit; color: blue; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; color: black; direction: ltr; display: inline; float: none; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt; product_number &lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator" style="box-sizing: inherit; color: #a67f59; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; color: black; direction: ltr; display: inline; float: none; font-family: Consolas,Monaco,&amp;amp;quot; andale mono&amp;amp;quot;,&amp;amp;quot;ubuntu mono&amp;amp;quot;,monospace; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; -ms-hyphens: none; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-shadow: 0px 1px white; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-break: normal; word-spacing: normal;"&gt;PM1&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token punctuation" style="box-sizing: inherit; color: #999999; font-family: &amp;amp;quot; helevticaneue-light&amp;amp;quot;,&amp;amp;quot;helvetica neue&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.2; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 16:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564680#M11096</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-08T16:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564682#M11097</link>
      <description>&lt;P&gt;Hard to tell without seeing your code. Most likely you accidentally removed the END= option from the SET statement so the CALL SYMPUTX() function that creates that macro variable never runs.&lt;/P&gt;
&lt;P&gt;If not then change the condition for the DO loop to also test the EOF variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;until(eof or length(pmlist)&amp;gt;31000)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Jun 2019 16:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564682#M11097</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-08T16:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564722#M11100</link>
      <description>Run just the data _null_ step and then check if the macro variable is being created. &lt;BR /&gt;&lt;BR /&gt;So the data _null_ step above and then:&lt;BR /&gt;&lt;BR /&gt;%PUT &amp;amp;pmlist.</description>
      <pubDate>Sun, 09 Jun 2019 01:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564722#M11100</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-09T01:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564756#M11105</link>
      <description>&lt;P&gt;Fantastic Tom! All I needed to do was add :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;until&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;eof or &lt;SPAN class="token function"&gt;length&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;pmlist&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;31000&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;) &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your help with this &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jacko&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2019 15:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564756#M11105</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-09T15:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564757#M11106</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add:&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;until&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;eof or &lt;SPAN class="token function"&gt;length&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;pmlist&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;31000&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your replies and help&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2019 15:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/564757#M11106</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-09T15:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Split Dataset By Number of Observations and Place in Macrovariables?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/565043#M11136</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you said 'You probably need to find another way to do your query since most systems are also going to start complaining if you give them really long lists of constant values.' Did you mean the piece of code you showed me could fail at some point? Would it ever reach a 'limit'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jacko&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 20:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Split-Dataset-By-Number-of-Observations-and-Place-in/m-p/565043#M11136</guid>
      <dc:creator>JackoNewbie</dc:creator>
      <dc:date>2019-06-10T20:24:41Z</dc:date>
    </item>
  </channel>
</rss>

