<?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: Caculated values to generate macro variable using INTO clause in PROC SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556315#M74737</link>
    <description>&lt;P&gt;What are trying to create?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is just the values from the third column then add two dummy target variables for the other columns&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
  select
     length(strip(name)) as _length
    ,anydigit(name) as digit_pos
    ,cats(name,'=',substr(name, 1, calculated digit_pos-2))
  into 
     :dummy
    ,:dummy
    ,:renamelistn separated by ' '
  from 
    dictionary.columns  
  where libname='WORK' and memname='VSPE_FMT' and anydigit(name)&amp;gt;0 
  ;
%put &amp;amp;renamelistn. ;
quit ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2019 00:08:59 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-05-06T00:08:59Z</dc:date>
    <item>
      <title>Caculated values to generate macro variable using INTO clause in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556313#M74736</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to generate a macro variable list&amp;nbsp;using proc sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using calculated values to generate the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this in the same step without generating the error (?):&lt;/P&gt;&lt;P&gt;"WARNING: INTO clause specifies fewer host variables than columns listed in the SELECT clause."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
	select
		length(strip(name)) as _length
		,anydigit(name) as digit_pos
		,cats(name,'=',substr(name, 1, calculated digit_pos-2))
	into 
		:renamelistn separated by ' '
	from 
		dictionary.columns  
			where libname='WORK' and memname='VSPE_FMT' and anydigit(name)&amp;gt;0 ;
%put &amp;amp;renamelistn. ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 00:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556313#M74736</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-05-06T00:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Caculated values to generate macro variable using INTO clause in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556315#M74737</link>
      <description>&lt;P&gt;What are trying to create?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is just the values from the third column then add two dummy target variables for the other columns&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
  select
     length(strip(name)) as _length
    ,anydigit(name) as digit_pos
    ,cats(name,'=',substr(name, 1, calculated digit_pos-2))
  into 
     :dummy
    ,:dummy
    ,:renamelistn separated by ' '
  from 
    dictionary.columns  
  where libname='WORK' and memname='VSPE_FMT' and anydigit(name)&amp;gt;0 
  ;
%put &amp;amp;renamelistn. ;
quit ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 00:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556315#M74737</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-06T00:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Caculated values to generate macro variable using INTO clause in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556316#M74738</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/155121"&gt;@mglogan&lt;/a&gt;&amp;nbsp; &amp;nbsp;Looks like you don't need this bit&lt;/P&gt;
&lt;P&gt;/* length(strip(name)) as _length*/&lt;BR /&gt;/* ,anydigit(name) as digit_pos*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
	select
/*		length(strip(name)) as _length*/
/*		,anydigit(name) as digit_pos*/
		cats(name,'=',substr(name, 1, anydigit(name)-2))
	into 
		:renamelistn separated by ' '
	from 
		dictionary.columns  
			where libname='WORK' and memname='VSPE_FMT' and anydigit(name)&amp;gt;0 ;
%put &amp;amp;renamelistn. ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should do&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 00:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556316#M74738</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-05-06T00:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Caculated values to generate macro variable using INTO clause in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556317#M74739</link>
      <description>&lt;P&gt;Oh yes! Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 00:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Caculated-values-to-generate-macro-variable-using-INTO-clause-in/m-p/556317#M74739</guid>
      <dc:creator>mglogan</dc:creator>
      <dc:date>2019-05-06T00:18:31Z</dc:date>
    </item>
  </channel>
</rss>

