<?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: Remove comma from macro numbers in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514865#M2819</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let new_numbers=;
%let nos = 9,999,999;

data temp;
	input numbers;
	datalines;
1
2
3
4
9999999
;
run;

proc sql noprint;
	select numbers
			into: new_numbers
		from temp
			where numbers=input("&amp;amp;nos.", comma32.);
	;
quit;
%put &amp;amp;=new_numbers;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or another way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let new_numbers=;
%let nos = 9,999,999;

data temp;
	input numbers;
	datalines;
1
2
3
4
9999999
;
run;

proc sql noprint;
	select numbers
			into: new_numbers
		from temp
			where numbers=input(compress("&amp;amp;nos.", ","), best32.);
	;
quit;
%put &amp;amp;=new_numbers;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Nov 2018 17:29:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-11-20T17:29:36Z</dc:date>
    <item>
      <title>Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514846#M2810</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can&amp;nbsp;I make this work please?&lt;/P&gt;&lt;P&gt;The macro variables nos has comma in its value.&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;Thanks&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;%let nos = 9,999,999;

data temp;
	input numbers;
	datalines;
1
2
3
4
9999999
;
run;

proc sql noprint;
	select numbers
			into: new_numbers
		from temp
			where numbers=&amp;amp;nos.
	;
quit;
%put &amp;amp;=new_numbers;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514846#M2810</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2018-11-20T17:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514855#M2813</link>
      <description>&lt;P&gt;You could use macro logic to remove the commas from the string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%sysfunc(compress(%superq(nos),%str(,)))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or since you seem to be using it as a number you could let SAS convert the string into a number&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input("&amp;amp;nos",comma32.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:26:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514855#M2813</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-20T17:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514860#M2815</link>
      <description>Will it always have commas? Or do you need to account for comma's and no commas?</description>
      <pubDate>Tue, 20 Nov 2018 17:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514860#M2815</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-20T17:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514863#M2817</link>
      <description>&lt;P&gt;Changed code to&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
	select numbers
			into: new_numbers
		from temp
			where numbers=%sysfunc(compress(%superq(&amp;amp;nos.) , %str(,) ) )
;quit;
%put &amp;amp;=new_numbers;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But it does not seem to be working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;36 proc sql noprint;&lt;BR /&gt;37 select numbers&lt;BR /&gt;38 into: new_numbers&lt;BR /&gt;39 from temp&lt;BR /&gt;40 where numbers=%sysfunc(compress(%superq(&amp;amp;nos.) , %str(,) ) )&lt;BR /&gt;ERROR: Invalid symbolic variable name 9,999,999.&lt;BR /&gt;41 ;&lt;BR /&gt;_&lt;BR /&gt;22&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,&lt;BR /&gt;a missing value, BTRIM, INPUT, PUT, SUBSTRING, USER.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514863#M2817</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2018-11-20T17:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514864#M2818</link>
      <description>&lt;P&gt;%SUPERQ() wants the name of the macro variable to quote. You gave it a number instead.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514864#M2818</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-20T17:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514865#M2819</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let new_numbers=;
%let nos = 9,999,999;

data temp;
	input numbers;
	datalines;
1
2
3
4
9999999
;
run;

proc sql noprint;
	select numbers
			into: new_numbers
		from temp
			where numbers=input("&amp;amp;nos.", comma32.);
	;
quit;
%put &amp;amp;=new_numbers;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or another way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let new_numbers=;
%let nos = 9,999,999;

data temp;
	input numbers;
	datalines;
1
2
3
4
9999999
;
run;

proc sql noprint;
	select numbers
			into: new_numbers
		from temp
			where numbers=input(compress("&amp;amp;nos.", ","), best32.);
	;
quit;
%put &amp;amp;=new_numbers;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514865#M2819</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-20T17:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514867#M2820</link>
      <description>&lt;P&gt;the macro variable would always have commas&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514867#M2820</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2018-11-20T17:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514868#M2821</link>
      <description>&lt;P&gt;Thank You Very Much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514868#M2821</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2018-11-20T17:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514869#M2822</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let nos = 9999999;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/514869#M2822</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-11-20T17:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Remove comma from macro numbers</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/515080#M2867</link>
      <description>&lt;P&gt;Same logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let new_numbers=;
%let nos = 9,999,999;

data temp;
	input numbers;
	datalines;
1
2
3
4
9999999
;
run;

proc sql noprint;
	select numbers
			into: new_numbers
		from temp
			where strip(put(numbers,comma32.))="&amp;amp;nos.";
	;
quit;
%put &amp;amp;new_numbers;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Nov 2018 13:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-comma-from-macro-numbers/m-p/515080#M2867</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-11-21T13:16:58Z</dc:date>
    </item>
  </channel>
</rss>

