<?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: PUT function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741575#M231820</link>
    <description>Problem still persist</description>
    <pubDate>Fri, 14 May 2021 21:51:53 GMT</pubDate>
    <dc:creator>CathyVI</dc:creator>
    <dc:date>2021-05-14T21:51:53Z</dc:date>
    <item>
      <title>PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741572#M231818</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using the put function to change a numeric varible to character variable. Then I will like to rename this observations.&lt;/P&gt;&lt;P&gt;I have used this method for practice and it worked but when I applied it, it didnt work.This is my code.&lt;/P&gt;&lt;P&gt;The only observation that showed in my new table is the &amp;nbsp;"missing2".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table pt_discstat as&lt;BR /&gt;select *,&lt;BR /&gt;case&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-999" then "missing2"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "12" then "homeH"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "11" then "hospice"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "10" then "otherD"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-9" then "missing"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-7" then "unknown"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-5" then "invalid"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "9" then "otherH"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "8" then "dead"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "7" then "court"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "6" then "long"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "5" then "short"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "4" then "LAMA"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "3" then "admit"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "1" then "home"&lt;BR /&gt;end as pt_recode&lt;BR /&gt;from pt_discharge_x&lt;BR /&gt;where pt_discharge in ("-999" "12" "11" "10" "-9" "-7" "-5" "9" "8" "7" "6" "5" "4" "3" "1");&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 21:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741572#M231818</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2021-05-14T21:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741573#M231819</link>
      <description>&lt;P&gt;Try putting commas in your IN statement:&lt;/P&gt;
&lt;PRE&gt;where pt_discharge in ("-999"&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt; "12"&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt; "11"&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt; "10"&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt; "-9"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "-7"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "-5"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "9"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "8"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "7"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "6"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "5"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "4"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "3"&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;,&lt;/FONT&gt;&lt;/STRONG&gt; "1");&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 May 2021 21:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741573#M231819</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2021-05-14T21:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741575#M231820</link>
      <description>Problem still persist</description>
      <pubDate>Fri, 14 May 2021 21:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741575#M231820</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2021-05-14T21:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741576#M231821</link>
      <description>&lt;P&gt;Is your question about the PUT function, as your title indicates? I don't see anything about that in your code. Either way, please include the relevant code and a sample of your input data and desired output data. Those are helpful to understand what "didnt work."&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 21:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741576#M231821</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2021-05-14T21:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741577#M231822</link>
      <description>&lt;P&gt;IMO, changing &lt;SPAN&gt;pt_discharge from numeric to character is not necessary here.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You may recode this using Formats.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Untested code :&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	value $ recode 
		-999 = "missing2"
		12 = "homeH"
		11 = "hospice"
		10 = "otherD"
		-9 = "missing"
		-7 = "unknown"
		-5 = "invalid"
		9 = "otherH"
		8 = "dead"
		7 = "court"
		6 = "long"
		5 = "short"
		4 = "LAMA"
		3 = "admit"
		1 = "home"
	;
run;

proc sql;
	create table pt_discstat as
		select *,
			 put(pt_discharge,$recode.) as	 pt_recode
			from pt_discharge_x
				where pt_discharge in (-999, 12, 11 ,10, -9 ,-7 ,-5, 9, 8, 7, 6, 5, 4, 3, 1);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 22:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741577#M231822</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2021-05-14T22:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741579#M231823</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am using the put function to change a numeric varible to character variable. Then I will like to rename this observations.&lt;/P&gt;
&lt;P&gt;I have used this method for practice and it worked but when I applied it, it didnt work.This is my code.&lt;/P&gt;
&lt;P&gt;The only observation that showed in my new table is the &amp;nbsp;"missing2".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table pt_discstat as&lt;BR /&gt;select *,&lt;BR /&gt;case&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-999" then "missing2"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "12" then "homeH"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "11" then "hospice"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "10" then "otherD"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-9" then "missing"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-7" then "unknown"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "-5" then "invalid"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "9" then "otherH"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "8" then "dead"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "7" then "court"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "6" then "long"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "5" then "short"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "4" then "LAMA"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "3" then "admit"&lt;BR /&gt;when pt_discharge =&amp;nbsp; "1" then "home"&lt;BR /&gt;end as pt_recode&lt;BR /&gt;from pt_discharge_x&lt;BR /&gt;where pt_discharge in ("-999" "12" "11" "10" "-9" "-7" "-5" "9" "8" "7" "6" "5" "4" "3" "1");&lt;BR /&gt;quit;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does your PT_discharge_x data set look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If these values are the result of your "put" to create character variables you likely need to share the code. The output of Put for a numeric value is usually right justified and so the results would have sign-ficant leading spaces that would not compare to most of your values. "&amp;nbsp;&amp;nbsp; 1" is not the same as "1".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example run this code and look at the results for the Char values.&lt;/P&gt;
&lt;PRE&gt;data example;
   input x;
   char1 = Quote(put(x,f4.));
   char2 = quote(put(x,f4. -L));

datalines;
-999
12
11
10
-9
-7
;&lt;/PRE&gt;
&lt;P&gt;The -L on the Put function left justifies results and likely is what you need. Trailing blanks as part of the value are ignored generally for comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 22:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741579#M231823</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-14T22:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741583#M231827</link>
      <description>&lt;P&gt;Sorry about the confusion my question is specific to the sql, case-when procedure not the put statement.&lt;BR /&gt;This is a synthesis data.&lt;BR /&gt;data test;&lt;BR /&gt;input patient;&lt;BR /&gt;datalines;&lt;BR /&gt;-999&lt;BR /&gt;12&lt;BR /&gt;11&lt;BR /&gt;10&lt;BR /&gt;-9&lt;BR /&gt;-7&lt;BR /&gt;-5&lt;BR /&gt;9&lt;BR /&gt;8&lt;BR /&gt;7&lt;BR /&gt;6&lt;BR /&gt;5&lt;BR /&gt;4&lt;BR /&gt;3&lt;BR /&gt;1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;The data is numeric and I converted into character using this code:&lt;BR /&gt;data test2;&lt;BR /&gt;set test;&lt;BR /&gt;pt_discharge=put(patient,4.);&lt;BR /&gt;run;&lt;BR /&gt;Now I will like to rename the observations from -999 to 1 to character values. This is the outcome (table) I hope to achieve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;patient&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;pt_discharge&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-999&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;missing2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;homeH&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;hospice&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;otherD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-9&lt;/TD&gt;&lt;TD&gt;missing&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-7&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;unknown&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-5&lt;/TD&gt;&lt;TD&gt;invalid&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;otherH&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;dead&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;court&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;long&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;short&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;LAMA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;admit&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;home&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 23:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741583#M231827</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2021-05-14T23:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741596#M231833</link>
      <description>&lt;P&gt;That is because it is the only value that matches the list in your WHERE clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use something like PUT(xxx,4.) to make&amp;nbsp;PT_DISCHARGE then the values are right aligned (have leading spaces).&amp;nbsp; You can use the -L modifier on your format specification to have them left aligned: PUT(xxx,4.-L)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To work with what you have try removing the leading spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where left(pt_discharge) in ("-999" "12" "11" "10" "-9" "-7" "-5" "9" "8" "7" "6" "5" "4" "3" "1");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you should get more matches.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course you also need to adjust the WHEN conditions.&amp;nbsp; You could use LEFT() there also to remove the leading spaces.&amp;nbsp; Or if you know how many leading spaces there are just include them in the comparison strings.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;when pt_discharge =  "-999" then "missing2"
when pt_discharge =  "  12" then "homeH"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 May 2021 03:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741596#M231833</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-15T03:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741609#M231846</link>
      <description>&lt;P&gt;No need to convert the values to alphanumeric, just use a format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value recode 
        -999 = "missing2" 
        12 = "homeH" 
        11 = "hospice" 
        10 = "otherD"
        -9 = "missing"
        -7 = "unknown"
        -5 = "invalid" 
        9 = "otherH" 
        8 = "dead" 
        7 = "court" 
        6 = "long" 
        5 = "short" 
        4 = "LAMA" 
        3 = "admit" 
        1 = "home"
   ;
run;

data want;
    set test;
    length pt_discharge $ 10;
    pt_discharge = put(patient, recode.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 May 2021 09:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741609#M231846</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-05-15T09:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741684#M231878</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry about the confusion my question is specific to the sql, case-when procedure not the put statement.&lt;BR /&gt;This is a synthesis data.&lt;BR /&gt;data test;&lt;BR /&gt;input patient;&lt;BR /&gt;datalines;&lt;BR /&gt;-999&lt;BR /&gt;12&lt;BR /&gt;11&lt;BR /&gt;10&lt;BR /&gt;-9&lt;BR /&gt;-7&lt;BR /&gt;-5&lt;BR /&gt;9&lt;BR /&gt;8&lt;BR /&gt;7&lt;BR /&gt;6&lt;BR /&gt;5&lt;BR /&gt;4&lt;BR /&gt;3&lt;BR /&gt;1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;The data is numeric and I converted into character using this code:&lt;BR /&gt;data test2;&lt;BR /&gt;set test;&lt;BR /&gt;pt_discharge=put(patient,4.);&lt;BR /&gt;run;&lt;BR /&gt;Now I will like to rename the observations from -999 to 1 to character values. This is the outcome (table) I hope to achieve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;patient&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;pt_discharge&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;-999&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;missing2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;12&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;homeH&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;11&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;hospice&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;otherD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;-9&lt;/TD&gt;
&lt;TD&gt;missing&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;-7&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;unknown&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;-5&lt;/TD&gt;
&lt;TD&gt;invalid&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;otherH&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;8&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;dead&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;court&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;long&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;short&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;LAMA&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;admit&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;home&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This&lt;/P&gt;
&lt;PRE&gt;pt_discharge=put(patient,4.);&lt;/PRE&gt;
&lt;P&gt;creates values that have leading blank characters for any value that can be displayed with 3,2 or 1 character.&lt;/P&gt;
&lt;P&gt;So your "=" does not match these created text values.&lt;/P&gt;
&lt;P&gt;Use&lt;/P&gt;
&lt;PRE&gt;pt_discharge=put(patient,4. -L);&lt;/PRE&gt;
&lt;P&gt;to left justify the resulting text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also need to be aware that most of the output will strip the leading space for display an you just don't see&lt;/P&gt;</description>
      <pubDate>Sun, 16 May 2021 02:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function/m-p/741684#M231878</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-16T02:36:24Z</dc:date>
    </item>
  </channel>
</rss>

