<?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: Variable will not reassign its value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487463#M127028</link>
    <description>&lt;P&gt;Thank you, I am trying to work with what everyone is telling me, but it is still not working. I changed the code so that col variables are no longer 0 (0.0) format. And tried to change the variables so that col_1 is numeric and not a character variable. But for some reason, col_1 is not actually&amp;nbsp; being converted to a numeric variable when I check in in the dataset num_prop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data num_prop1;&lt;BR /&gt;set num_prop (keep=vname rowlabel _type_ col_1 col_2 col_3 comnum);&lt;BR /&gt;numcol1=input(col_1,8.0);&lt;BR /&gt;drop col_1;&lt;BR /&gt;rename numcol1=col_1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data num_prop1 ;&lt;BR /&gt;&amp;nbsp; length rowlabel $100 col_1 col_2&amp;nbsp; col_3 col_4 $32 ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; merge num_prop bignumber;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by comnum;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_1=cat(strip(put(col_1, 8.0)),' (', strip(put((col_1/bigcol1)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_2=cat(strip(put(col_2, 8.0)),' (', strip(put((col_2/bigcol2)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_3=cat(strip(put(col_3, 8.0)),' (', strip(put((col_3/bigcol3)*100,8.1)) ,'%)');&lt;BR /&gt;vorder=1;&lt;BR /&gt;roworder=2;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Aug 2018 14:59:06 GMT</pubDate>
    <dc:creator>kmardinian</dc:creator>
    <dc:date>2018-08-16T14:59:06Z</dc:date>
    <item>
      <title>Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487090#M126855</link>
      <description>&lt;P&gt;Hi, I am trying to create a table with variables col_1, col_2, col_3, to be reassigned to the values below, but for some reason they only show up as (%) with no numbers assigned to them. I have checked my bigcol variables and they do have values. Any advice is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data num_prop ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; retain rowlabel col_1 col_2 col_3 comnum ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; merge num_prop bignumber;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by comnum;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rowlabel=' n(Proportion)';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if col_1 ne '0(0.0)' then col_1=cat(strip(put(col_1, 8.0)),' (', strip(put((col_1/bigcol1)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else col_1=col_1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if col_2 ne '0(0.0)' then col_2=cat(strip(put(col_2, 8.0)),' (', strip(put((col_2/bigcol2)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else col_2=col_2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if col_3 ne '0(0.0)' then col_3=cat(strip(put(col_3, 8.0)),' (', strip(put((col_3/bigcol3)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else col_3=col_3;&lt;BR /&gt;vorder=1;&lt;BR /&gt;roworder=3;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 17:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487090#M126855</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T17:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487098#M126858</link>
      <description>&lt;P&gt;col_1 (and so on) seem to be character, and contain values which cannot automatically be converted to numbers. See the log for this (Maxim 2). Also see Maxim 3 (Know your data).&lt;/P&gt;
&lt;P&gt;If that doesn't provide enough help, post the log (use the {i} button).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 17:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487098#M126858</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-15T17:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487105#M126864</link>
      <description>&lt;P&gt;Thank you for your help, for some reason, now, nothing is showing up for all the col variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;7930&amp;nbsp;&amp;nbsp; data num_prop ;&lt;BR /&gt;7931&amp;nbsp;&amp;nbsp; retain rowlabel col_1 col_2 col_3 comnum ;&lt;BR /&gt;7932&amp;nbsp;&amp;nbsp; merge num_prop bignumber;&lt;BR /&gt;7933&amp;nbsp;&amp;nbsp; numcol_1=input(col_1,best32.);&lt;BR /&gt;7934&amp;nbsp;&amp;nbsp; numcol_2=input(col_2,best32.);&lt;BR /&gt;7935&amp;nbsp;&amp;nbsp; numcol_3=input(col_3,best32.);&lt;BR /&gt;7936&amp;nbsp;&amp;nbsp; drop col_1 col_2 col_3;&lt;BR /&gt;7937&amp;nbsp;&amp;nbsp; rename numcol_1=col_1 numcol_2=col_2 numcol_3=col_3;&lt;BR /&gt;7938&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by comnum;&lt;BR /&gt;7939&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowlabel=' n(Proportion)';&lt;BR /&gt;7940&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if col_1 ne '0(0.0)' then col_1=cat(strip(put(col_1, 8.0)),' (', strip(put((col_1/bigcol1)*100,8.1)) ,'%)');&lt;BR /&gt;7941&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else col_1=col_1;&lt;BR /&gt;7942&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if col_2 ne '0(0.0)' then col_2=cat(strip(put(col_2, 8.0)),' (', strip(put((col_2/bigcol2)*100,8.1)) ,'%)');&lt;BR /&gt;7943&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else col_2=col_2;&lt;BR /&gt;7944&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if col_3 ne '0(0.0)' then col_3=cat(strip(put(col_3, 8.0)),' (', strip(put((col_3/bigcol3)*100,8.1)) ,'%)');&lt;BR /&gt;7945&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else col_3=col_3;&lt;BR /&gt;7946&amp;nbsp;&amp;nbsp; vorder=1;&lt;BR /&gt;7947&amp;nbsp;&amp;nbsp; roworder=3;&lt;BR /&gt;7948&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7940:80&amp;nbsp;&amp;nbsp; 7942:80&amp;nbsp;&amp;nbsp; 7944:80&lt;BR /&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 at 7940:85&amp;nbsp;&amp;nbsp; 1 at 7940:94&amp;nbsp;&amp;nbsp; 1 at 7942:85&amp;nbsp;&amp;nbsp; 1 at 7942:94&amp;nbsp;&amp;nbsp; 1 at 7944:85&amp;nbsp;&amp;nbsp; 1 at 7944:94&lt;BR /&gt;NOTE: There were 0 observations read from the data set WORK.NUM_PROP.&lt;BR /&gt;NOTE: There were 1 observations read from the data set WORK.BIGNUMBER.&lt;BR /&gt;NOTE: The data set WORK.NUM_PROP has 1 observations and 13 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.02 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:11:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487105#M126864</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T18:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487107#M126865</link>
      <description>&lt;P&gt;Here's a simplified version of your program (very simplified!) so you can experiment with it and see where you are going wrong:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;col_1 = '5(25.0)';&lt;/P&gt;
&lt;P&gt;col_1a = put(col_1, 8.0);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, even the strongest SAS programmers have to read the log and figure out what the notes mean, to diagnose a problem.&amp;nbsp; As a relative beginner, that's a habit you need to adopt.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487107#M126865</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T18:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487110#M126866</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here's a simplified version of your program (very simplified!) so you can experiment with it and see where you are going wrong:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;col_1 = '5(25.0)';&lt;/P&gt;
&lt;P&gt;col_1a = put(col_1, 8.0);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, even the strongest SAS programmers have to read the log and figure out what the notes mean, to diagnose a problem.&amp;nbsp; As a relative beginner, that's a habit you need to adopt.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;perhaps you also intended to include a: col_num = input(col_1,8.); or similar?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487110#M126866</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-15T18:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487111#M126867</link>
      <description>&lt;P&gt;I ran the test code and it works, it replaces col_1a with '5(25.0)' But I'm not sure what that tells me? That its not a problem with the variable, but the syntax in my code? Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487111#M126867</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T18:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487112#M126868</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, I meant to leave it as is.&amp;nbsp; I know it doesn't work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original post seems to assume that the incoming variable COL_1 might contain "0(0.0)"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's probably wrong, and in fact I'm not even sure that there is an incoming variable named COL_1.&amp;nbsp; There might be.&amp;nbsp; Even if there is, we don't really know if it's character or numeric.&amp;nbsp; So I pushed the question back to the original poster, to (I hope) force some learning about what is in the data, and what the issues are in getting the PUT function to work at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure that is the best approach ... I just think it's a decent approach.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487112#M126868</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T18:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487117#M126874</link>
      <description>&lt;P&gt;Did the log really say nothing about using a character string and the 8.0 format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to experiment with a few variations, such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test2;&lt;/P&gt;
&lt;P&gt;col_1 = 'abcdefghijklmnop';&lt;/P&gt;
&lt;P&gt;col_1a = put(col_1, 8.0);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test3;&lt;/P&gt;
&lt;P&gt;col_1 = 20;&lt;/P&gt;
&lt;P&gt;col_1a = put(col_1, 8.0);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start off by getting a feel for what the PUT function expects as input, and what it produces as output.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487117#M126874</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T18:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487120#M126876</link>
      <description>&lt;P&gt;I added this below code to ensure that col variables are equal to '0(0.0%)' and I checked, the col variables are character. I already tried changing them to numeric and still doesn't work after that is done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data num_prop;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; length rowlabel $100 col_1 col_2 col_3 col_4 $32 ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rowlabel='&amp;nbsp;&amp;nbsp;&amp;nbsp; n (Proportion)';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_1='0 (0.0%)';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_2='0 (0.0%)';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_3='0 (0.0%)';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_4='';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; roworder=3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vorder=1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data num_prop;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set num_prop ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; comnum=1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort;&lt;BR /&gt;by comnum;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data num_prop ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; retain rowlabel col_1 col_2 col_3 comnum ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; merge num_prop bignumber;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; by comnum;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rowlabel=' n(Proportion)';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if col_1 = '0(0.0)' then col_1=cat(strip(put(col_1, 32.0)),' (', strip(put((col_1/bigcol1)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else col_1=col_1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if col_2 = '0(0.0)' then col_2=cat(strip(put(col_2, 8.0)),' (', strip(put((col_2/bigcol2)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else col_2=col_2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if col_3 = '0(0.0)' then col_3=cat(strip(put(col_3, 8.0)),' (', strip(put((col_3/bigcol3)*100,8.1)) ,'%)');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; else col_3=col_3;&lt;BR /&gt;vorder=1;&lt;BR /&gt;roworder=3;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487120#M126876</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T18:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487123#M126878</link>
      <description>&lt;P&gt;No, the log didn't list anything&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;13404&lt;BR /&gt;13405&amp;nbsp; data numprop;&lt;BR /&gt;13406&lt;BR /&gt;13407&amp;nbsp; col_1 = '5(25.0)';&lt;BR /&gt;13408&lt;BR /&gt;13409&amp;nbsp; col_1a = put(col_1, 8.0);&lt;BR /&gt;13410&lt;BR /&gt;13411&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The data set WORK.NUMPROP has 1 observations and 2 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am going to play around with the put statement and see if I can figure it out. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487123#M126878</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T18:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487126#M126880</link>
      <description>&lt;P&gt;That's unexpected (having no additional notes in the log), and a change in how SAS works.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a way to zero in on the problem, based on the notes you received earlier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an invalid calculation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;col_1 = '5(25.0)';&lt;/P&gt;
&lt;P&gt;bigcol1 = 1000;&lt;/P&gt;
&lt;P&gt;ratio = col_1 / bigcol1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's no way to convert COL_1 to a legitimate number that can be used in a formula.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487126#M126880</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T18:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487128#M126882</link>
      <description>&lt;P&gt;292&amp;nbsp; data numprop;&lt;BR /&gt;293&lt;BR /&gt;294&amp;nbsp; col_1 = '5(25.0)';&lt;BR /&gt;295&amp;nbsp; bigcol1=1000;&lt;BR /&gt;296&amp;nbsp; ratio=col_1/bigcol1;&lt;BR /&gt;297&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: Character values have been converted to numeric values at the places given by:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 296:7&lt;BR /&gt;NOTE: Invalid numeric data, col_1='5(25.0)' , at line 296 column 7.&lt;BR /&gt;col_1=5(25.0) bigcol1=1000 ratio=. _ERROR_=1 _N_=1&lt;BR /&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 at 296:12&lt;BR /&gt;NOTE: The data set WORK.NUMPROP has 1 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it converted col_1 to numeric, but seems to not like the format it's in?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487128#M126882</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T18:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487130#M126883</link>
      <description>&lt;P&gt;The note is saying that COL_1 can't really be converted to numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What number would it be?&amp;nbsp; 5?&amp;nbsp; 25?&amp;nbsp; It just isn't a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you would like to find the number before what is in parentheses, there are ways to do that.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487130#M126883</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T18:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487140#M126887</link>
      <description>&lt;P&gt;When I check the dataset num_prop before I run that particular code. The col variable has this description:&lt;/P&gt;&lt;P&gt;Name:col_1&lt;/P&gt;&lt;P&gt;Label=^(N=21)&lt;/P&gt;&lt;P&gt;Format: $32&lt;/P&gt;&lt;P&gt;Type: Character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with 3 Observations of 12, 9, 21&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487140#M126887</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T19:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487142#M126889</link>
      <description>&lt;P&gt;So I guess I am confused by the fact that I cannot convert this variable from character to numeric since all 3 of its observations are numbers.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487142#M126889</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T19:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487149#M126894</link>
      <description>&lt;P&gt;SAS has no trouble converting "12" to a number, and performing math with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;col_1="12";&lt;/P&gt;
&lt;P&gt;result = 2 * col_1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is in the denominators?&amp;nbsp; (BIGCOL1 for example may not contain a valid numeric expression.)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487149#M126894</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T19:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487154#M126896</link>
      <description>&lt;P&gt;You're right, I can do calculations with col_1, but I checked and, bigcol1,2,3 are all numeric. And I did the same test with bigcol1 and SAS also can perform math with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bigcol:&lt;/P&gt;&lt;P&gt;Length: 8&lt;/P&gt;&lt;P&gt;Format: Best12.&lt;/P&gt;&lt;P&gt;Type: Numeric&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:38:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487154#M126896</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T19:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487156#M126897</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Did the log really say nothing about using a character string and the 8.0 format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to experiment with a few variations, such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test2;&lt;/P&gt;
&lt;P&gt;col_1 = 'abcdefghijklmnop';&lt;/P&gt;
&lt;P&gt;col_1a = put(col_1, 8.0);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test3;&lt;/P&gt;
&lt;P&gt;col_1 = 20;&lt;/P&gt;
&lt;P&gt;col_1a = put(col_1, 8.0);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start off by getting a feel for what the PUT function expects as input, and what it produces as output.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Apparently SAS has changed some behavior about use of the numeric F&amp;nbsp;format &amp;nbsp;such as 8. when using put. Other numeric formats such as BEST8. or comma8. generate the expected&lt;/P&gt;
&lt;PRE&gt;NOTE 484-185: Format $BEST was not found or could not be loaded.

&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487156#M126897</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-15T19:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487157#M126898</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That's unexpected (having no additional notes in the log), and a change in how SAS works.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a way to zero in on the problem, based on the notes you received earlier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an invalid calculation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;col_1 = '5(25.0)';&lt;/P&gt;
&lt;P&gt;bigcol1 = 1000;&lt;/P&gt;
&lt;P&gt;ratio = col_1 / bigcol1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's no way to convert COL_1 to a legitimate number that can be used in a formula.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The PUT() function can use both character and numeric inputs.&amp;nbsp; SAS is "kind" enough to convert the format specification to match the type of the input.&amp;nbsp; So you effectively used the $8. format instead of the F8.0 format, which is why the output matched the input (or at least the first 8 characters of the input.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try it with the&amp;nbsp; PUTN() function instead and you should see notes in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:41:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487157#M126898</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-15T19:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable will not reassign its value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487162#M126902</link>
      <description>&lt;P&gt;Hi Tom, it unfortunately gave me the same thing as before and just printed (%) for col variables, it also still lists col variables as character after I run this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I try and convert the col variables to numeric using PUTN in a separate data step before I run this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3945&amp;nbsp; data num_prop ;&lt;BR /&gt;3946&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain rowlabel col_1 col_2 col_3 ;&lt;BR /&gt;3947&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge num_prop bignumber;&lt;BR /&gt;3948&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by comnum;&lt;BR /&gt;3949&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if col_1 ne '0(0.0)' then col_1=cat(strip(putn(col_1, 8.0)),' (', strip(putn((col_1/bigcol1)*100,8.1)) ,'%)');&lt;BR /&gt;3950&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else col_1=col_1;&lt;BR /&gt;3951&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if col_2 ne '0(0.0)' then col_2=cat(strip(putn(col_2, 8.0)),' (', strip(putn((col_2/bigcol2)*100,8.1)) ,'%)');&lt;BR /&gt;3952&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else col_2=col_2;&lt;BR /&gt;3953&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if col_3 ne '0(0.0)' then col_3=cat(strip(putn(col_3, 8.0)),' (', strip(putn((col_3/bigcol3)*100,8.1)) ,'%)');&lt;BR /&gt;3954&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else col_3=col_3;&lt;BR /&gt;3955&amp;nbsp; vorder=1;&lt;BR /&gt;3956&amp;nbsp; roworder=2;&lt;BR /&gt;3957&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3949:51&amp;nbsp;&amp;nbsp; 3949:82&amp;nbsp;&amp;nbsp; 3951:51&amp;nbsp;&amp;nbsp; 3951:82&amp;nbsp;&amp;nbsp; 3953:51&amp;nbsp;&amp;nbsp; 3953:82&lt;BR /&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3949:58&amp;nbsp;&amp;nbsp;&amp;nbsp; 3949:101&amp;nbsp;&amp;nbsp; 3951:58&amp;nbsp;&amp;nbsp;&amp;nbsp; 3951:101&amp;nbsp;&amp;nbsp; 3953:58&amp;nbsp;&amp;nbsp;&amp;nbsp; 3953:101&lt;BR /&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 at 3949:87&amp;nbsp;&amp;nbsp; 1 at 3949:96&amp;nbsp;&amp;nbsp; 1 at 3951:87&amp;nbsp;&amp;nbsp; 1 at 3951:96&amp;nbsp;&amp;nbsp; 1 at 3953:87&amp;nbsp;&amp;nbsp; 1 at 3953:96&lt;BR /&gt;NOTE: There were 0 observations read from the data set WORK.NUM_PROP.&lt;BR /&gt;NOTE: There were 1 observations read from the data set WORK.BIGNUMBER.&lt;BR /&gt;NOTE: The data set WORK.NUM_PROP has 1 observations and 13 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.02 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:48:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-will-not-reassign-its-value/m-p/487162#M126902</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-08-15T19:48:45Z</dc:date>
    </item>
  </channel>
</rss>

