<?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: Error reading in column to be renamed in SAS Software for Learning Community</title>
    <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901122#M1530</link>
    <description>It did work. I received no errors and the master table was updated with the values from Table1 under the desired "processed" column. Thank you!</description>
    <pubDate>Wed, 01 Nov 2023 17:15:27 GMT</pubDate>
    <dc:creator>JibJam221</dc:creator>
    <dc:date>2023-11-01T17:15:27Z</dc:date>
    <item>
      <title>Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901072#M1516</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with some complicated column names. Id like to rename these columns to follow SAS naming conventions and output into a new table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All was going well, but now there are a bunch of (more complicated) column names that will not get read in.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Master;
	set work.master
	WORK.TABLE1(rename=("#"n=Number REC=Record  Comm=Comments "Processed IN/OUT"n=Processed_in_out "Reading IN/OUT"n=Reading));
run;&lt;/PRE&gt;
&lt;P&gt;the error states that the variables "Processed IN/OUT" and "Reading IN/OUT" are not on file WORK.TABLE1. So to confirm, I ran a code that outputs all of the column names in TABLE1, and copied/pasted the names of the columns so its exactly what is listed in the table. However it still doesn't work...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;am I missing something?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901072#M1516</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-01T14:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901076#M1517</link>
      <description>&lt;P&gt;Please show us the ENTIRE log for this DATA step. We need the ENTIRE log for this data step, not just the errors. Please copy the log as text and paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaigeMiller_0-1663012019648.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75161i0E71B1489A6C9839/image-size/large?v=v2&amp;amp;px=999" role="button" title="PaigeMiller_0-1663012019648.png" alt="PaigeMiller_0-1663012019648.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901076#M1517</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-01T14:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901079#M1518</link>
      <description>&lt;PRE&gt;26         data Master;
27         	set work.Master
28         	WORK.TABLE1(rename=("#"n=Number REC=Record Comm=Comments REC=Record "Processed IN/OUT"n=Processed_in_out));
ERROR: Variable 'Processed IN/OUT'n is not on file WORK.TABLE1.
ERROR: Invalid DROP, KEEP, or RENAME option on file WORK.TABLE1.
29         
30         
31         run;&lt;/PRE&gt;
&lt;P&gt;Here it is&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901079#M1518</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-01T14:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901082#M1519</link>
      <description>&lt;P&gt;Depending on exactly how you "looked" at the names you might be missing a leading space in the name.&lt;/P&gt;
&lt;P&gt;If you ran proc contents or similar and looking in the results window a leading space is not shown in the table.&lt;/P&gt;
&lt;P&gt;Trailing spaces don't seem to have this issue though.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options validvarname=any;

data junk;
  "name no leading space"n=3;
  " name with leading space"n=4;
  "name with trailing space "n=5;
run;

proc contents data=junk;
run;&lt;/PRE&gt;
&lt;P&gt;The proc contents output:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Variables" cellspacing="0" cellpadding="3"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" colspan="4" scope="colgroup"&gt;Alphabetic List of Variables and Attributes&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;Len&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;name with leading space&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;name no leading space&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;name with trailing space&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that "name with leading space does not show the actual space. Clue: sort order is alphbetical. Why does "name with" appear before "name no"???&lt;/P&gt;
&lt;P&gt;and using rename syntax:&lt;/P&gt;
&lt;PRE&gt;38   data newjunk;
39      set junk (rename = ( "name no leading space"n=noleadspace
40                           "name with leading space"n=withlead
41                           "name with trailing space"n=trailspace
42                          )
43                )
44      ;
ERROR: Variable 'name with leading space'n is not on file WORK.JUNK.
ERROR: Invalid DROP, KEEP, or RENAME option on file WORK.JUNK.
45   run;

&lt;/PRE&gt;
&lt;P&gt;So I suspect one or more leading spaces in your name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901082#M1519</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-11-01T14:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901083#M1520</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207689"&gt;@JibJam221&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;26         data Master;
27         	set work.Master
28         	WORK.TABLE1(rename=("#"n=Number REC=Record Comm=Comments REC=Record "Processed IN/OUT"n=Processed_in_out));
ERROR: Variable 'Processed IN/OUT'n is not on file WORK.TABLE1.
ERROR: Invalid DROP, KEEP, or RENAME option on file WORK.TABLE1.
29         
30         
31         run;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So the variable is not in the data set TABLE1. Please run PROC CONTENTS on data set TABLE1 and show us the output.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 14:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901083#M1520</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-01T14:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901084#M1521</link>
      <description>&lt;TABLE width="722"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="93"&gt;Member&lt;/TD&gt;
&lt;TD width="37"&gt;Num&lt;/TD&gt;
&lt;TD width="213"&gt;Variable&lt;/TD&gt;
&lt;TD width="37"&gt;Type&lt;/T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;Char&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;322&lt;/TD&gt;
&lt;TD&gt;$3.&lt;/TD&gt;
&lt;TD&gt;$3.00&lt;/TD&gt;
&lt;TD width="144"&gt;Processed&lt;BR /&gt;IN/OUT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;WORK.TABLE1&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD width="213"&gt;Reading&lt;BR /&gt;IN/OUT&lt;/TD&gt;
&lt;TD&gt;Char&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;325&lt;/TD&gt;
&lt;TD&gt;$3.&lt;/TD&gt;
&lt;TD&gt;$3.00&lt;/TD&gt;
&lt;TD width="144"&gt;Reading&lt;BR /&gt;IN/OUT&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried copying the variable name directly from this table and still no luck.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901084#M1521</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-01T15:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901085#M1522</link>
      <description>&lt;P&gt;It's impossible to know from this presentation if the character(s) after Processed and before IN/OUT are one or more blanks, or even if they are special non-printing characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about showing us the output from this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=work.table1 noprint out=_contents_;
run;
proc print data=_contents_(where=(name=:'P'));
    var name;
    format name $hex.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901085#M1522</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-01T15:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901086#M1523</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207689"&gt;@JibJam221&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;TABLE width="722"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="93"&gt;Member&lt;/TD&gt;
&lt;TD width="37"&gt;Num&lt;/TD&gt;
&lt;TD width="213"&gt;Variable&lt;/TD&gt;
&lt;TD width="37"&gt;Type&lt;/TD&gt;
&lt;TD width="35"&gt;Len&lt;/TD&gt;
&lt;TD width="35"&gt;Pos&lt;/TD&gt;
&lt;TD width="64"&gt;Format&lt;/TD&gt;
&lt;TD width="64"&gt;Informat&lt;/TD&gt;
&lt;TD width="144"&gt;Label&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;WORK.TABLE1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;#&lt;/TD&gt;
&lt;TD&gt;Num&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;BEST.&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;#&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;WORK.TABLE1&lt;/TD&gt;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;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried copying the variable name directly from this table and still no luck.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;ODS output routinely strips leading characters in display. See my other post for a created example.&lt;/P&gt;
&lt;P&gt;This is one way to get the name in a data set that you can copy from and see leading spaces.&lt;/P&gt;
&lt;PRE&gt;options validvarname=any;

data junk;
  "name no leading space"n=3;
  " name with leading space"n=4;
  "name with trailing space "n=5;
run;

proc sql;
   create table names as
   select name 
   from dictionary.columns 
   where libname='WORK' and memname='JUNK';
quit;
&lt;/PRE&gt;
&lt;P&gt;The libname and memname (data set) names in the code must be in uppercase as they are stored in the SAS metadata as such.&lt;/P&gt;
&lt;P&gt;Note that if you have changed the VALIDVARNAME setting then the SQL will return 0 rows as the names aren't actual "valid" in the session anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 15:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901086#M1523</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-11-01T15:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901098#M1524</link>
      <description>&lt;TABLE width="1165"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;LIBNAME&lt;/TD&gt;
&lt;TD width="64"&gt;MEMNAME&lt;/TD&gt;
&lt;TD width="192"&gt;MEMLABEL&lt;/TD&gt;
&lt;TD width="141"&gt;TYPEMEM&lt;/TD&gt;
&lt;TD width="295"&gt;NAME&lt;/TD&gt;
&lt;TD width="64"&gt;TYPE&lt;/TD&gt;
&lt;TD width="64"&gt;LENGTH&lt;/T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TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;WORK&lt;/TD&gt;
&lt;TD&gt;TABLE1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="295"&gt;Processed&lt;BR /&gt;IN/OUT&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD width="64"&gt;Processed&lt;BR /&gt;IN/OUT&lt;/TD&gt;
&lt;TD&gt;$&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;WORK&lt;/TD&gt;
&lt;TD&gt;TABLE1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="295"&gt;Reading&lt;BR /&gt;IN/OUT&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD width="64"&gt;Reading&lt;BR /&gt;IN/OUT&lt;/TD&gt;
&lt;TD&gt;$&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 01 Nov 2023 16:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901098#M1524</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-01T16:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901100#M1525</link>
      <description>&lt;P&gt;Hi, I don't know what this is, but it is not what I asked for. This is what I asked for:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=work.table1 noprint out=_contents_;
run;
proc print data=_contents_(where=(name=:'P'));
    var name;
    format name $hex.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Nov 2023 16:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901100#M1525</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-01T16:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901103#M1526</link>
      <description>&lt;P&gt;that was the output data from that exact code run..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can paste the results as well but not sure what that is...&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;TABLE class="table" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt; &lt;COL class="rowheader" /&gt; &lt;COL class="data" /&gt; &lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="header" scope="colgroup"&gt;Obs&lt;/TH&gt;
&lt;TH class="header" scope="colgroup"&gt;NAME&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="b rowheader"&gt;34&lt;/TD&gt;
&lt;TD class="b data"&gt;53637265656E696E670D0A494E2F4F5554202020202020202020202020202020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="b rowheader"&gt;35&lt;/TD&gt;
&lt;TD class="b data"&gt;5365637572697479202020202020202020202020202020202020202020202020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="b rowheader"&gt;36&lt;/TD&gt;
&lt;TD class="b data"&gt;536F757263652020202020202020202020202020202020202020202020202020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;BR /&gt;as well as the log:&amp;nbsp;
&lt;PRE&gt;NOTE: There was 1 observation read from the data set WORK._CONTENTS_.
      WHERE name=:'P';
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 16:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901103#M1526</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-01T16:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901109#M1527</link>
      <description>&lt;P&gt;So this tells us that the 10th character (the first 9 being the word Processed) in the variable name is '0D'x which means that it is not a space, it is a carriage return character, and the 11th character is '0A'x which is a line feed character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So when you refer to the variable name in SAS, you cannot refer to it with a space in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe this will work, but I cannot test it, you can.&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;set work.Master
    WORK.TABLE1(rename=("#"n=Number REC=Record Comm=Comments REC=Record "53637265656E696E670D0A494E2F4F5554"x=Processed_in_out));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This illustrates an important point. I think people should avoid like the plague creating variables with names that are not valid SAS variable names. Using variable names that are not valid SAS variable names causes all sorts of problems, this is just one illustration.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 16:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901109#M1527</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-01T16:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901116#M1528</link>
      <description>&lt;P&gt;WOW!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much for the explanation. Im trying to clean up and combine multiple very very messy datasets from Excel... created by non-data people. I think it may be worth me changing the name directly in excel before moving forward, since im assuming multiple columns will have this issue (they have similar formatting).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for helping me out and giving an explanation - definitely a learning lesson for me!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 17:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901116#M1528</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-01T17:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901117#M1529</link>
      <description>&lt;P&gt;Well, yes I agree, if you can clean this up in Excel you will be better off than trying to clean this up in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you really didn't provide the feedback that I was expecting (and other readers might be expecting). Did my code work, or not?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 17:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901117#M1529</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-01T17:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901122#M1530</link>
      <description>It did work. I received no errors and the master table was updated with the values from Table1 under the desired "processed" column. Thank you!</description>
      <pubDate>Wed, 01 Nov 2023 17:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901122#M1530</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-01T17:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901158#M1532</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207689"&gt;@JibJam221&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It did work. I received no errors and the master table was updated with the values from Table1 under the desired "processed" column.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is interesting because it does &lt;EM&gt;not&lt;/EM&gt; work on my Windows SAS 9.4M5:&lt;/P&gt;
&lt;PRE&gt;829   data Master;
830   set work.master
831       WORK.TABLE1(rename=("#"n=Number REC=Record Comm=Comments REC=Record "53637265656E696E670D0A494E2F4F5554"x=Processed_in_out));
                                                                              &lt;FONT color="#FF0000"&gt;-------------------------------------&lt;/FONT&gt;
                                                                              &lt;FONT color="#FF0000"&gt;214&lt;/FONT&gt;
                                                                              &lt;FONT color="#FF0000"&gt;23&lt;/FONT&gt;
&lt;FONT color="#FF0000"&gt;ERROR 214-322: Variable name "53637265656E696E670D0A494E2F4F5554"x is not valid.&lt;/FONT&gt;

&lt;FONT color="#FF0000"&gt;ERROR 23-7: Invalid value for the RENAME option.&lt;/FONT&gt;

832   run;&lt;/PRE&gt;
&lt;P&gt;(Also note that the duplication of &lt;FONT face="courier new,courier"&gt;REC=Record&lt;/FONT&gt; alone would throw an error and that&amp;nbsp;&lt;FONT face="courier new,courier"&gt;"53637265656E696E67"x = "Screening"&lt;/FONT&gt;, not &lt;FONT face="courier new,courier"&gt;"Processed"&lt;/FONT&gt;.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What &lt;EM&gt;does&lt;/EM&gt; work on my computer is to supply the offending characters in a macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('CRLF','0D0A'x);
run;

data Master;
set work.master
    WORK.TABLE1(rename=("#"n=Number REC=Record Comm=Comments "Processed&amp;amp;CRLF.IN/OUT"n=Processed_in_out));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Nov 2023 20:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901158#M1532</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-11-01T20:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901161#M1533</link>
      <description>&lt;P&gt;Set the SAS option VALIDVARNAME to V7 before trying to convert the worksheet into a SAS dataset.&lt;/P&gt;
&lt;P&gt;That way SAS will generate valid SAS names from the beginning.&amp;nbsp; It should replace those goofy characters with underscore characters.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 21:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901161#M1533</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-01T21:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901243#M1535</link>
      <description>&lt;P&gt;Hi tom,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used a macro to read-in all of the files at once using Proc Import. Would I use the VALIDVARNAME before running this chunk of the code?&lt;/P&gt;
&lt;PRE&gt;%macro Readin;
%do i = 1 %to 13;
    Proc Import Out=Work.Table&amp;amp;i
    datafile= "....../Table&amp;amp;i..xlsx"
    DBMS=XLSX REPLACE;
    GETNAMES=YES;
    run; 

%end;

%mend;

%readin;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Nov 2023 14:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901243#M1535</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2023-11-02T14:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901249#M1536</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=v7;
%readin;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have other SAS dataset with non-standard names you need to deal with you might need to change it back to ANY after you have read in the XLSX files.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 14:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901249#M1536</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-11-02T14:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error reading in column to be renamed</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901251#M1537</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207689"&gt;@JibJam221&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;WOW!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much for the explanation. Im trying to clean up and combine multiple very very messy datasets from Excel... created by non-data people. I think it may be worth me changing the name directly in excel before moving forward, since im assuming multiple columns will have this issue (they have similar formatting).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for helping me out and giving an explanation - definitely a learning lesson for me!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't know how you are bringing the data into SAS but strongly suspect Proc Import may play a role.&lt;/P&gt;
&lt;P&gt;If you are reading multiple files of the exact same structure (Excel column order and "basically the same" column headers) then you would be better off by 1) save each sheet to CSV prior to reading and 2) use a data step to read the CSV. Then you won't have any of the obnoxious bits from import of changing variable names, types and lengths of character values that will occur with Import.&lt;/P&gt;
&lt;P&gt;If you are not reading multiple files and do use Proc import then set: OPTIONS VALIDVARNAME=V7; before import. That will strip out obnoxious characters replacing them with _ so will be much&amp;nbsp; more of the "what you see is actually there".&lt;/P&gt;
&lt;P&gt;The data step to read the CSV also means that you set the names, so ugly renames may not be needed at all.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 15:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Error-reading-in-column-to-be-renamed/m-p/901251#M1537</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-11-02T15:02:52Z</dc:date>
    </item>
  </channel>
</rss>

