<?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: how to get/link new variables in SAS from 2 Excel sheets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468346#M119607</link>
    <description>&lt;P&gt;Hi Vince,&lt;/P&gt;
&lt;P&gt;thanks for you answer, what do you suggest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;Lalo&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jun 2018 12:53:47 GMT</pubDate>
    <dc:creator>lalohg</dc:creator>
    <dc:date>2018-06-07T12:53:47Z</dc:date>
    <item>
      <title>how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467779#M119431</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;
&lt;P&gt;I have a big data set (few rows as an example in Sheet1 of the attached Excel file) with patients and 6 causes of diseases (columns A to H in sheet1) coded according to the ICD-10 codes (Sheet2). I would like to get the name of the disease but only for cancer (ICD-10 codes from C00 to C97) on separated columns (columns J to O in sheet1) by linking both sheets.&lt;/P&gt;
&lt;P&gt;Could you please help me with the SAS code to get columns J to 0?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Lalo.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 18:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467779#M119431</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-05T18:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467798#M119433</link>
      <description>&lt;P&gt;The proper programming interface for MS Office is Visual Basic. If you have problems with that, you should ask in a Microsoft-oriented forum.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 18:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467798#M119433</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-05T18:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467800#M119434</link>
      <description>&lt;P&gt;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; Thanks Kurt, but I would like to it in SAS, instead of the Excel file suposse I already imported it from SAS the two Excel Sheets on separated SAS files.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 18:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467800#M119434</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-05T18:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467804#M119435</link>
      <description>&lt;P&gt;Post SAS datasets as data steps, see my footnotes.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 19:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467804#M119435</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-05T19:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467811#M119436</link>
      <description>&lt;P&gt;thanks anyway..... I'll see what I can do&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 19:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/467811#M119436</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-05T19:13:21Z</dc:date>
    </item>
    <item>
      <title>merging two excel seets to create new variables in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468018#M119502</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;
&lt;P&gt;I have a big data set (few rows are shown as an example in Sheet1 of the attached Excel file) with patients and 6 causes of diseases (columns A to H in sheet1) coded according to the ICD-10 codes (Sheet2). I would like to get the name of the disease but only for cancer (ICD-10 codes from C00 to C97) on separated columns (columns J to O in sheet1) by linking both sheets.&lt;/P&gt;
&lt;P&gt;Could you please help me with the SAS code to get columns J to 0?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Lalo.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 11:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468018#M119502</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-06T11:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468051#M119516</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Using a SAS format may give you the results that you want.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;This code assumes that you have the data in SAS tables named WORK.SHEET1 (patient data) and WORK.SHEET2 (ICD-10 data).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any validmemname=extend nodate nonumber ls=max;

*  Create the CNTLIN table for use with PROC FORMAT;

data work.disease_cntlin;
set work.Sheet2;
length fmtname $7 type $1 start end $3 label $256;
drop 'ICD-10 Code'n 'Disease name'n;

*  Specify the required information for the format;

fmtname = 'DISEASE';
type    = 'C';
start   = 'ICD-10 Code'n;
end     = 'ICD-10 Code'n;
label   = 'Disease name'n;
run;

*  Create the DISEASE format;

proc format cntlin=work.disease_cntlin; run; quit;

*  Display the data using the DISEASE format;

proc print data=work.Sheet1 label;
  format cause1--cause6 $disease.;
  label cause1 = 'Cancer name 1'
        cause2 = 'Cancer name 2'
        cause3 = 'Cancer name 3'
        cause4 = 'Cancer name 4'
        cause5 = 'Cancer name 5'
        cause6 = 'Cancer name 6';
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 19:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468051#M119516</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-06-06T19:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468165#M119550</link>
      <description>&lt;P&gt;Thanks Vince,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran your code and got the following error messages in the Log Window&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;309 start = 'ICD-10 Code'n ;&lt;BR /&gt;ERROR: The name ICD-10 Code is not a valid SAS name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;313 * Create the DISEASE format;&lt;BR /&gt;314 proc format cntlin=disease_cntlin;&lt;BR /&gt;ERROR: For format $DISEASE, this range is repeated, or values overlap: ICD-ICD.&lt;BR /&gt;314! run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;317 format cause1--cause7 $disease.;&lt;BR /&gt;ERROR: formato $DISEASE no se he encontrado o no se puede cargar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wonder what went wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all your help is very much appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Eduardo&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 19:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468165#M119550</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-06T19:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468169#M119552</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;My apology; it was a copy-and-paste error.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I updated the SAS code to include the VALIDVARNAME and VALIDMEMNAME options.&amp;nbsp; Unfortunately the comment is flowing up to the same line as the options, and I can't seem to get it to appear on its own line again.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 19:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468169#M119552</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-06-06T19:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468346#M119607</link>
      <description>&lt;P&gt;Hi Vince,&lt;/P&gt;
&lt;P&gt;thanks for you answer, what do you suggest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;Lalo&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 12:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468346#M119607</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-07T12:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468350#M119609</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Did the code that I provided give you the results that you need?&amp;nbsp; Attached&amp;nbsp;is an Excel workbook showing the results.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 13:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468350#M119609</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-06-07T13:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468351#M119610</link>
      <description>&lt;P&gt;No, I get the error messages that I mentioned. You mentioned "&lt;SPAN&gt;include the VALIDVARNAME and VALIDMEMNAME options" where should I include them in your original code?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 13:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468351#M119610</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-07T13:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468353#M119612</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39435"&gt;@lalohg&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;No, I get the error messages that I mentioned. You mentioned "&lt;SPAN&gt;include the VALIDVARNAME and VALIDMEMNAME options" where should I include them in your original code?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13635"&gt;@Vince_SAS&lt;/a&gt; edited &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468051#M119516" target="_blank"&gt;his post&lt;/A&gt;. Just copy the code from there.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 13:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468353#M119612</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-07T13:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468417#M119635</link>
      <description>&lt;P&gt;Hi Vince,&lt;/P&gt;
&lt;P&gt;I ran the code but more than replacing the codes with the disease name, I wanted to create new variables but that's fine. One last question, how can I save the proc print output log into a SAS table when running the proc print procedure?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 15:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468417#M119635</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-07T15:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468419#M119637</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I don't understand what you mean by this:&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39435"&gt;@lalohg&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;save the proc print output log into a SAS table&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Can you explain that?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 15:42:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468419#M119637</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-06-07T15:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468422#M119639</link>
      <description>&lt;P&gt;When I run the last part:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;work&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Sheet1 &lt;SPAN class="token function"&gt;label&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt; cause1&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;cause6 &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;disease&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token function"&gt;label&lt;/SPAN&gt; cause1 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Cancer name 1'&lt;/SPAN&gt;
        cause2 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Cancer name 2'&lt;/SPAN&gt;
        cause3 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Cancer name 3'&lt;/SPAN&gt;
        cause4 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Cancer name 4'&lt;/SPAN&gt;
        cause5 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Cancer name 5'&lt;/SPAN&gt;
        cause6 &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'Cancer name 6'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the work.sheet1 has the original variables without the disease names, I only see the names of diseases when running the "proc print data=work.sheet1 label"&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 15:48:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468422#M119639</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-07T15:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468430#M119642</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The LABEL option only affects the display of column labels (headings).&amp;nbsp; It has no effect on the data values.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Try this code to see if it gives you what you need:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any validmemname=extend nodate nonumber ls=max;

*  Create the CNTLIN table for use with PROC FORMAT;

data work.disease_cntlin;
set work.Sheet2;
length fmtname $7 type $1 start end $3 label $256;
drop 'ICD-10 Code'n 'Disease name'n;

*  Specify the required information for the format;

fmtname = 'DISEASE';
type    = 'C';
start   = 'ICD-10 Code'n;
end     = 'ICD-10 Code'n;
label   = 'Disease name'n;
run;

*  Create the DISEASE format;

proc format cntlin=work.disease_cntlin; run; quit;

*  Create a new table with separate columns for the diseases;

data work.Sheet1_New;
set work.Sheet1;
length disease1-disease6 $256;
disease1 = put(cause1, $disease.);
disease2 = put(cause2, $disease.);
disease3 = put(cause3, $disease.);
disease4 = put(cause4, $disease.);
disease5 = put(cause5, $disease.);
disease6 = put(cause6, $disease.);
run;

*  Display the data;

title 'Labels NOT used in column headings';

proc print data=work.Sheet1_New;
  label disease1 = 'Cancer name 1'
        disease2 = 'Cancer name 2'
        disease3 = 'Cancer name 3'
        disease4 = 'Cancer name 4'
        disease5 = 'Cancer name 5'
        disease6 = 'Cancer name 6';
run; quit;

title 'Labels used in column headings';

proc print data=work.Sheet1_New label;
  label disease1 = 'Cancer name 1'
        disease2 = 'Cancer name 2'
        disease3 = 'Cancer name 3'
        disease4 = 'Cancer name 4'
        disease5 = 'Cancer name 5'
        disease6 = 'Cancer name 6';
run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 16:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468430#M119642</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-06-07T16:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468445#M119651</link>
      <description>&lt;P&gt;sorry, I got another errors&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;69 disease1 = put(cause1, $disease.);&lt;BR /&gt; ---------&lt;BR /&gt; 48&lt;BR /&gt;WARNING: Variable cause1 has already been defined as numeric.&lt;BR /&gt;70 disease2 = put(cause2, $disease.);&lt;BR /&gt; ---------&lt;BR /&gt; 48&lt;BR /&gt;WARNING: Variable cause2 has already been defined as numeric.&lt;BR /&gt;71 disease3 = put(cause3, $disease.);&lt;BR /&gt; ---------&lt;BR /&gt; 48&lt;BR /&gt;WARNING: Variable cause3 has already been defined as numeric.&lt;BR /&gt;72 disease4 = put(cause4, $disease.);&lt;BR /&gt; ---------&lt;BR /&gt; 48&lt;BR /&gt;WARNING: Variable cause4 has already been defined as numeric.&lt;BR /&gt;73 disease5 = put(cause5, $disease.);&lt;/P&gt;
&lt;P&gt;---------&lt;BR /&gt; 48&lt;BR /&gt;WARNING: Variable cause5 has already been defined as numeric.&lt;BR /&gt;74 disease6 = put(cause6, $disease.);&lt;/P&gt;
&lt;P&gt;WARNING: Variable cause6 has already been defined as numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 16:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468445#M119651</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-07T16:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468447#M119652</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I don't know what the problem is.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I just copied and pasted the complete SAS code into a new SAS session, and it worked without error.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 16:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468447#M119652</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-06-07T16:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to get/link new variables in SAS from 2 Excel sheets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468455#M119655</link>
      <description>&lt;P&gt;Hi Vince&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My mistake, I got mixed up with the variable names. Your code ran just fine!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for all your help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 17:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-link-new-variables-in-SAS-from-2-Excel-sheets/m-p/468455#M119655</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2018-06-07T17:06:33Z</dc:date>
    </item>
  </channel>
</rss>

