<?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: Is there an alternative to macro variable size limitation to use in Teradata query using sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491429#M128868</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL NOPRINT;

SELECT quote (CUST_ID,"'")

INTO : CUST_ID separated by ', '

FROM work.'DATA Some CHARTS_0000'N;

QUIT;

%put macro variable CUST_ID:&amp;amp; CUST_ID;





/*with in code I use to use like this- CUST_ID IN (&amp;amp;CUST_ID)*/




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The sas dataset is not recognised in terdata using sas which is the main problem.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Aug 2018 21:03:23 GMT</pubDate>
    <dc:creator>Vk_2</dc:creator>
    <dc:date>2018-08-30T21:03:23Z</dc:date>
    <item>
      <title>Is there an alternative to macro variable size limitation to use in Teradata query using sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491415#M128859</link>
      <description>&lt;P&gt;I have a query like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL ;
connect to teradata as tera1 (server='XXXXX' user=&amp;amp;userid pwd=&amp;amp;pwd database ="XXXX" tpt=yes fastexport=yes);
create table TRANS as
select  * from connection to tera1
(
SELECT CUST_ID,FIELD2, FIELD3,field4  from table1 where CUST_ID IN
(select CUST_ID 
from table2 group by 1) 
group by 1,2,3,4);
disconnect from tera1;
QUIT;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The fields that I am interested is in teradata. I get the list in Excel,I&amp;nbsp; use values of cust_id in a macro variable and use it in the above code .But&amp;nbsp; Since the CUST_ID I am interested in is exceeding the macro variable capacity of&amp;nbsp;65540. The only work around that I am&amp;nbsp;doing is to create a table(table2) in teradata and using it.&amp;nbsp; Is there any alternative to do this task?&lt;/P&gt;&lt;P&gt;using sas eg 7.12&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 20:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491415#M128859</guid>
      <dc:creator>Vk_2</dc:creator>
      <dc:date>2018-08-30T20:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to macro variable size limitation to use in Teradata query using sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491427#M128866</link>
      <description>&lt;P&gt;Since your code does not show any obvious use of macro variables it is hard to tell how you may be attempting to use one.&lt;/P&gt;
&lt;P&gt;Most of the approaches that I have seen people exceed the default sizes of the macro variables are putting data into variables in a sub-optimal manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have hundreds of values it is often better to place the values in a data set/table and use an appropriate join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Such as&lt;/P&gt;
&lt;PRE&gt;data have;
  input name $;
datalines;
Alfred
James
Judy
Thomas
;
run;

proc sql;
   create table want as
   select b.* 
   from have as a
        left join
        sashelp.class as b
        on a.name=b.name
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;Where the HAVE set would contain you customer id's if I am understanding the situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 20:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491427#M128866</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-30T20:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to macro variable size limitation to use in Teradata query using sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491429#M128868</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL NOPRINT;

SELECT quote (CUST_ID,"'")

INTO : CUST_ID separated by ', '

FROM work.'DATA Some CHARTS_0000'N;

QUIT;

%put macro variable CUST_ID:&amp;amp; CUST_ID;





/*with in code I use to use like this- CUST_ID IN (&amp;amp;CUST_ID)*/




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The sas dataset is not recognised in terdata using sas which is the main problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 21:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491429#M128868</guid>
      <dc:creator>Vk_2</dc:creator>
      <dc:date>2018-08-30T21:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to macro variable size limitation to use in Teradata query using sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491440#M128877</link>
      <description>&lt;P&gt;If you are using passthrough SQL you need to move the data set to the data base.&lt;/P&gt;
&lt;P&gt;If the data set only contains the ID values you need and there are not millions of them the upload should not take much time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 21:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491440#M128877</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-30T21:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to macro variable size limitation to use in Teradata query using sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491448#M128883</link>
      <description>&lt;P&gt;You can use a macro that will place the values at run time, instead of a macro variable list.&lt;/P&gt;
&lt;P&gt;See an example here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/39/605.html" target="_blank"&gt;http://support.sas.com/kb/39/605.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I feel like there was a better reference but I can't find it at the moment.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 22:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491448#M128883</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-30T22:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to macro variable size limitation to use in Teradata query using sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491542#M128934</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/137266"&gt;@Vk_2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL NOPRINT;

SELECT quote (CUST_ID,"'")

INTO : CUST_ID separated by ', '

FROM work.'DATA Some CHARTS_0000'N;

QUIT;

%put macro variable CUST_ID:&amp;amp; CUST_ID;





/*with in code I use to use like this- CUST_ID IN (&amp;amp;CUST_ID)*/




&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The sas dataset is not recognised in terdata using sas which is the main problem.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A clear abuse of the macro facility. Extract the CUST_ID into a dataset, and use that for further coding:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;create a format from it&lt;/LI&gt;
&lt;LI&gt;read it into a hash table&lt;/LI&gt;
&lt;LI&gt;do a join&lt;/LI&gt;
&lt;LI&gt;use it for a sub-select&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you need it on the teradata side, write it to a temporary table there and use that in SQL for joining or a sub-select.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 07:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-alternative-to-macro-variable-size-limitation-to-use/m-p/491542#M128934</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-31T07:35:58Z</dc:date>
    </item>
  </channel>
</rss>

