<?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 Change value in a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/358960#M84384</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I write this as a datastep to change&amp;nbsp;the actual values stored in the variable 'LBTEST' in 9.4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use the below Proc format and then Proc Print the updated values show, but how can I save the updated dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value $LBTEST&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Albumin (Alb)'='Albumin'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Alanine aminotransferase (ALT)'='Alanine aminotransferase'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Alkaline phosphatase (ALP)'='Alkaline phosphatase'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 'Aspartate aminotransferase (AST)'='Aspartate aminotransferase'&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'Basophils - % (Baso %)'='Basophils (%)'&lt;BR /&gt;&amp;nbsp; 'Basophils - Absolute (Baso Abs)'='Basophils (Abs)'&lt;BR /&gt;&amp;nbsp;'Blood urea nitrogen (BUN)'='Blood urea nitrogen'&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=ABNLABKEEP;&lt;BR /&gt;format LBTEST $LBTEST.;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2017 10:06:10 GMT</pubDate>
    <dc:creator>mgerberhome0</dc:creator>
    <dc:date>2017-05-16T10:06:10Z</dc:date>
    <item>
      <title>Change value in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/358960#M84384</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I write this as a datastep to change&amp;nbsp;the actual values stored in the variable 'LBTEST' in 9.4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use the below Proc format and then Proc Print the updated values show, but how can I save the updated dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value $LBTEST&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Albumin (Alb)'='Albumin'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Alanine aminotransferase (ALT)'='Alanine aminotransferase'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Alkaline phosphatase (ALP)'='Alkaline phosphatase'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 'Aspartate aminotransferase (AST)'='Aspartate aminotransferase'&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'Basophils - % (Baso %)'='Basophils (%)'&lt;BR /&gt;&amp;nbsp; 'Basophils - Absolute (Baso Abs)'='Basophils (Abs)'&lt;BR /&gt;&amp;nbsp;'Blood urea nitrogen (BUN)'='Blood urea nitrogen'&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=ABNLABKEEP;&lt;BR /&gt;format LBTEST $LBTEST.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 10:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/358960#M84384</guid>
      <dc:creator>mgerberhome0</dc:creator>
      <dc:date>2017-05-16T10:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change value in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/358963#M84386</link>
      <description>&lt;P&gt;Do you mean ?:&lt;/P&gt;&lt;P&gt;data ABNLABKEEP;&lt;/P&gt;&lt;P&gt;set ABNLABKEEP;&lt;/P&gt;&lt;P&gt;format LBTEST $LBTEST.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 10:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/358963#M84386</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-05-16T10:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Change value in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/358966#M84388</link>
      <description>&lt;P&gt;To actually change the values:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data WANT;&lt;/P&gt;
&lt;P&gt;set ABNLABKEEP;&lt;/P&gt;
&lt;P&gt;LBTEST = put(LBTEST, $LBTEST.);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 10:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/358966#M84388</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-16T10:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Change value in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/359065#M84433</link>
      <description>&lt;P&gt;Or perhaps make that format an INVALUE and use it as an INFORMAT to read the data. This may be a better option in the long run if you are reading multiple files with the same contents.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 14:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/359065#M84433</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-16T14:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Change value in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/359219#M84476</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get an error.... &lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8923iCCBFE7359C33D68F/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="SnipImage.JPG" title="SnipImage.JPG" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 22:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/359219#M84476</guid>
      <dc:creator>mgerberhome0</dc:creator>
      <dc:date>2017-05-16T22:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change value in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/359223#M84477</link>
      <description>&lt;P&gt;I have to guess that you made some kind of mistake in creating the format. The following works for me:&lt;/P&gt;
&lt;PRE&gt;data ABNLABKEEP;
  informat lbtest $80.;
  input lbtest &amp;amp;;
  cards;
Albumin (Alb)
Alanine aminotransferase (ALT)
Alkaline phosphatase (ALP)
Aspartate aminotransferase (AST)
Basophils - % (Baso %)
Basophils - Absolute (Baso Abs)
Blood urea nitrogen (BUN)
;

proc format;
value $LBTEST
        'Albumin (Alb)'='Albumin'
       'Alanine aminotransferase (ALT)'='Alanine aminotransferase'
       'Alkaline phosphatase (ALP)'='Alkaline phosphatase'
      'Aspartate aminotransferase (AST)'='Aspartate aminotransferase'
   'Basophils - % (Baso %)'='Basophils (%)'
  'Basophils - Absolute (Baso Abs)'='Basophils (Abs)'
 'Blood urea nitrogen (BUN)'='Blood urea nitrogen'
run;

data WANT;
set ABNLABKEEP;
LBTEST = put(LBTEST, $LBTEST.);
run;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2017 22:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-value-in-a-dataset/m-p/359223#M84477</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-16T22:59:11Z</dc:date>
    </item>
  </channel>
</rss>

