<?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: All variables in array list must be the same type in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986451#M379935</link>
    <description>&lt;P&gt;Thank you so much for your reply! This is the log I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;35 data long;&lt;BR /&gt;36 set new;&lt;BR /&gt;37 array _FruitWt (*) Day0_FruitWt Day3_FruitWt Day7_FruitWt ;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;38 array _Color(*) Day0_Color Day3_Color Day7_Color ;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;39 array _Rind (*) Day0_Rind Day3_Rind Day7_Rind;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;40 array _Button (*) Day0_Button Day3_Button Day7_Button;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;41 array _Wtloss (*) Day0_Wtloss Day3_Wtloss Day7_Wtloss;&lt;BR /&gt;42 do i=1 to dim(_FruitWt);&lt;BR /&gt;43 label=scan(vname(_FruitWt(i)), 1, "_");&lt;BR /&gt;44 FruitWt=_FruitWt(i);&lt;BR /&gt;45 Color=_Color(i);&lt;BR /&gt;46 Rind=_Rind(i);&lt;BR /&gt;47 Button=_Button(i);&lt;BR /&gt;48 Wtloss=_Wtloss(i);&lt;BR /&gt;49 output;&lt;BR /&gt;50 end;&lt;BR /&gt;51 drop Day0_: Day3_: Day7_: i;&lt;BR /&gt;52 run;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2026 15:52:07 GMT</pubDate>
    <dc:creator>palolix</dc:creator>
    <dc:date>2026-04-16T15:52:07Z</dc:date>
    <item>
      <title>ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986358#M379914</link>
      <description>&lt;P&gt;Dear SAS Community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get this 'ERROR: All variables in array list must be the same type' when using this code after transposing data from wide to long format. All this variables (FruitWt, Color, Rind, Button, Wtloss) are numeric variables, but since my data set starts with missing values (.) maybe that is why? I would greatly appreciate your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data long;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; set new;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; array _FruitWt (*) Day0_FruitWt Day3_FruitWt Day7_FruitWt ;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; array _Color(*) Day0_Color Day3_Color Day7_Color ;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; array _Rind (*) Day0_Rind Day3_Rind Day7_Rind;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; array _Button (*) Day0_Button Day3_Button Day7_Button;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; array _Wtloss (*) Day0_Wtloss Day3_Wtloss Day7_Wtloss;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; do i=1 to dim(_FruitWt);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=scan(vname(_FruitWt(i)), 1, "_");&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FruitWt=_FruitWt(i);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Color=_Color(i);&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Rind=_Rind(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Button=_Button(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Wtloss=_Wtloss(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; end;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; drop Day0_: Day3_: Day7_: i;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Here is the data new:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.NEW" frame="box" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Test&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Grower&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Treatment&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;FruitNr&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Day0_FruitWt&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Day0_Color&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Day0_Rind&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Day0_Button&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;TRT_day3&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day3_FruitWt&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day3_Color&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day3_Rind&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day3_Button&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day7_FruitWt&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day7_Color&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day7_Rind&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Day7_Button&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Day3_Wtloss&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;Day7_Wtloss&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;Initial&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;146.15&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;TD class="l data"&gt;NA&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;Initial&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;TD class="r data"&gt;218.42&lt;/TD&gt;
&lt;TD class="r data"&gt;5&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="l data"&gt;NA&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;Initial&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="r data"&gt;164.77&lt;/TD&gt;
&lt;TD class="r data"&gt;5&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="l data"&gt;NA&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;Initial&lt;/TD&gt;
&lt;TD class="r data"&gt;4&lt;/TD&gt;
&lt;TD class="r data"&gt;174.28&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="l data"&gt;NA&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;Initial&lt;/TD&gt;
&lt;TD class="r data"&gt;5&lt;/TD&gt;
&lt;TD class="r data"&gt;157.36&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="l data"&gt;NA&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Apr 2026 01:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986358#M379914</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-15T01:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986359#M379915</link>
      <description>&lt;P&gt;That is easy. Using the following code to check whether all these variables (under ARRAY statement) are&amp;nbsp; numeric type or not ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc contents data=new varnum;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Apr 2026 01:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986359#M379915</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-04-15T01:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986360#M379916</link>
      <description>&lt;P&gt;How did you create the dataset NEW?&amp;nbsp; You mentioned that you transposed it.&amp;nbsp; How did you do that?&amp;nbsp; And how did you create the dataset you transposed to make NEW?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You mentioned missing values.&amp;nbsp; Whether a variable has any missing values should not change the TYPE of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the TABLE (as in a table in a report, as opposed to an actual SAS dataset) that you shared does have the string 'NA' showing as the only values in the column headed by TRT_day3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So perhaps you started with a CSV file generated by R or some other system that inserts that string instead of just leaving the field empty when the value is missing.&amp;nbsp; If you try to use some type of automatic tool for converting a CSV file into a SAS dataset (such as PROC IMPORT) then those NA strings in the CSV file will cause the variables to be made as character.&amp;nbsp; PROC IMPORT will also make any column that only has digit strings as the values as numeric, even if you meant the variable to be character. Also PROC IMPORT will define any variable that is missing on all observations as character (because a one byte character variable takes less storage space than an eight byte numeric variable).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 05:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986360#M379916</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-15T05:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986375#M379917</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;All this variables (FruitWt, Color, Rind, Button, Wtloss) are numeric variables&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It sounds like you are just stating this as a fact, rather than confirming this by running PROC CONTENTS. I have a rule here, when SAS says something is false and the human user says it is true, I believe SAS. (In my experience, SAS is right 99.99% of the time) So please check PROC CONTENTS.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 12:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986375#M379917</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-04-15T12:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986400#M379920</link>
      <description>&lt;P&gt;When SAS tells you that the variable types don't match, then&amp;nbsp;&lt;STRONG&gt;they do not match, period&lt;/STRONG&gt;..&lt;/P&gt;
&lt;P&gt;Run PROC CONTENTS to see where the issue is..&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2026 19:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986400#M379920</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2026-04-15T19:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986415#M379922</link>
      <description>&lt;P&gt;I am going to throw in a style choice that your or your office is made that is making you write more code than is needed for array processing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By placing the interval measures of 0, 3, 7 (or others) in the middle of the variable name you keep yourself from using the variable list features of SAS.&lt;/P&gt;
&lt;P&gt;If the variables were named for example FruitWt_Day0, FruitWt_Day3 and Fruitwt_Day7 you could write the ARRAY statement as:&lt;/P&gt;
&lt;P&gt;Array _FruitWt (*) Fruitwt:&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;The colon immediately after FruitWt tells SAS to use all the variables whose names start with Fruitwt. Or if you have other such variables then use Fruitwt_Day:&amp;nbsp; to get only those suffixed with Day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you actually run Proc Contents yet? Or opened the data set and examined ALL the variables used in those array statements? Or actually closely read the LOG? That particular error will only appear immediately after the statement causing the error. Se this example from my&amp;nbsp;&lt;STRONG&gt;log.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;187  data junk;
188    set sashelp.class;
189    Array x (*) Name sex height;
ERROR: All variables in array list must be the same type, i.e., all
       numeric or character.
190    array y (*) age height weight;
191  run;
&lt;/PRE&gt;
&lt;P&gt;So be reading the log I can tell that one of the variables referenced on the Array X statement has a problem. So it is one of Name Sex or Height. The first two are character and the third is numeric.&lt;/P&gt;
&lt;P&gt;As shown by this from Proc Contents:&lt;/P&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;&lt;A name="IDX3" target="_blank"&gt;&lt;/A&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;3&lt;/TH&gt;
&lt;TD class="l data"&gt;Age&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;4&lt;/TH&gt;
&lt;TD class="l data"&gt;Height&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&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&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;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Sex&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="l data"&gt;Weight&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;</description>
      <pubDate>Thu, 16 Apr 2026 06:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986415#M379922</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2026-04-16T06:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986447#M379933</link>
      <description>&lt;P&gt;Thank you Ksharp!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I got:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Varnum" frame="box" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="7" scope="colgroup"&gt;Variables in Creation Order&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Len&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Format&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Informat&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Label&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;Test&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BEST.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;Test&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;Grower&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BEST.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;Grower&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;Treatment&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;TREATMENT.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;Treatment&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="l data"&gt;FruitNr&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BEST.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;FruitNr&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="l data"&gt;Day0_FruitWt&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BEST.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;Day0_FruitWt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;6&lt;/TH&gt;
&lt;TD class="l data"&gt;Day0_Color&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BEST.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;Day0_Color&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;7&lt;/TH&gt;
&lt;TD class="l data"&gt;Day0_Rind&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BEST.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;Day0_Rind&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;8&lt;/TH&gt;
&lt;TD class="l data"&gt;Day0_Button&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BEST.&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;Day0_Button&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;9&lt;/TH&gt;
&lt;TD class="l data"&gt;TRT_day3&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;TD class="l data"&gt;$3.&lt;/TD&gt;
&lt;TD class="l data"&gt;$3.&lt;/TD&gt;
&lt;TD class="l data"&gt;TRT_day3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;10&lt;/TH&gt;
&lt;TD class="l data"&gt;Day3_FruitWt&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day3_FruitWt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;11&lt;/TH&gt;
&lt;TD class="l data"&gt;Day3_Color&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day3_Color&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;12&lt;/TH&gt;
&lt;TD class="l data"&gt;Day3_Rind&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day3_Rind&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;13&lt;/TH&gt;
&lt;TD class="l data"&gt;Day3_Button&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day3_Button&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;14&lt;/TH&gt;
&lt;TD class="l data"&gt;Day7_FruitWt&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;6&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;$6.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day7_FruitWt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;15&lt;/TH&gt;
&lt;TD class="l data"&gt;Day7_Color&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day7_Color&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;16&lt;/TH&gt;
&lt;TD class="l data"&gt;Day7_Rind&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day7_Rind&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;17&lt;/TH&gt;
&lt;TD class="l data"&gt;Day7_Button&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;$1.&lt;/TD&gt;
&lt;TD class="l data"&gt;Day7_Button&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;18&lt;/TH&gt;
&lt;TD class="l data"&gt;Day3_Wtloss&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;19&lt;/TH&gt;
&lt;TD class="l data"&gt;Day7_Wtloss&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Apr 2026 15:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986447#M379933</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-16T15:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986449#M379934</link>
      <description>&lt;P&gt;Thank you so much Tom for your feedbak!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually I imported the data from excel like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;proc import out=wide&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; datafile="G:\Shared drives\Arpaia Lab Group\Citrus Degreening Project\Citrus degreening statistics\Degreening.xlsx"&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; dbms=xlsx&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; replace;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; sheet='Navel_all';&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; getnames=YES;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*define format*/&lt;/DIV&gt;
&lt;DIV&gt;proc format;&lt;/DIV&gt;
&lt;DIV&gt;value Treatment&amp;nbsp; &amp;nbsp;0 = 'Initial' 1 = 'Air' 2 = 'Air + C2H4' 3 = 'Air + 1% CO2' 4 = 'Air + 2.5% CO2' 5 = 'Air + 5% CO2';&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*apply format to data*/&lt;/DIV&gt;
&lt;DIV&gt;data wide2;&lt;/DIV&gt;
&lt;DIV&gt;set wide;&lt;/DIV&gt;
&lt;DIV&gt;format Treatment Treatment.;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*create a new variable*/&lt;/DIV&gt;
&lt;DIV&gt;data new;&lt;/DIV&gt;
&lt;DIV&gt;set wide2;&lt;/DIV&gt;
&lt;DIV&gt;Day3_Wtloss = 100 -(Day3_FruitWt/Day0_FruitWt *100);&lt;/DIV&gt;
&lt;DIV&gt;Day7_Wtloss = 100 -(Day7_FruitWt/Day0_FruitWt *100);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;/*view dataset*/&lt;/DIV&gt;
&lt;DIV&gt;proc print data=new;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;In my excel file, only the variable TRT_day3 has character values, all the other have numeric values. However, variables Day3_FruitWt to Day7_Button start with missing values indicated by a (.)&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;TABLE width="1429"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="70"&gt;Test&lt;/TD&gt;
&lt;TD width="70"&gt;Grower&lt;/TD&gt;
&lt;TD width="78"&gt;Treatment&lt;/TD&gt;
&lt;TD width="70"&gt;FruitNr&lt;/TD&gt;
&lt;TD width="99"&gt;Day0_FruitWt&lt;/TD&gt;
&lt;TD width="88"&gt;Day0_Color&lt;/TD&gt;
&lt;TD width="78"&gt;Day0_Rind&lt;/TD&gt;
&lt;TD width="94"&gt;Day0_Button&lt;/TD&gt;
&lt;TD width="72"&gt;TRT_day3&lt;/TD&gt;
&lt;TD width="99"&gt;Day3_FruitWt&lt;/TD&gt;
&lt;TD width="84"&gt;Day3_Color&lt;/TD&gt;
&lt;TD width="78"&gt;Day3_Rind&lt;/TD&gt;
&lt;TD width="94"&gt;Day3_Button&lt;/TD&gt;
&lt;TD width="99"&gt;Day7_FruitWt&lt;/TD&gt;
&lt;TD width="84"&gt;Day7_Color&lt;/TD&gt;
&lt;TD width="78"&gt;Day7_Rind&lt;/TD&gt;
&lt;TD width="94"&gt;Day7_Button&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;146.15&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD width="72"&gt;NA&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;218.42&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD width="72"&gt;NA&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;164.77&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD width="72"&gt;NA&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;174.28&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD width="72"&gt;NA&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;157.36&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD width="72"&gt;NA&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;TD width="99"&gt;.&lt;/TD&gt;
&lt;TD width="84"&gt;.&lt;/TD&gt;
&lt;TD width="78"&gt;.&lt;/TD&gt;
&lt;TD width="94"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Apr 2026 15:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986449#M379934</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-16T15:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986451#M379935</link>
      <description>&lt;P&gt;Thank you so much for your reply! This is the log I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;35 data long;&lt;BR /&gt;36 set new;&lt;BR /&gt;37 array _FruitWt (*) Day0_FruitWt Day3_FruitWt Day7_FruitWt ;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;38 array _Color(*) Day0_Color Day3_Color Day7_Color ;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;39 array _Rind (*) Day0_Rind Day3_Rind Day7_Rind;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;40 array _Button (*) Day0_Button Day3_Button Day7_Button;&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;BR /&gt;41 array _Wtloss (*) Day0_Wtloss Day3_Wtloss Day7_Wtloss;&lt;BR /&gt;42 do i=1 to dim(_FruitWt);&lt;BR /&gt;43 label=scan(vname(_FruitWt(i)), 1, "_");&lt;BR /&gt;44 FruitWt=_FruitWt(i);&lt;BR /&gt;45 Color=_Color(i);&lt;BR /&gt;46 Rind=_Rind(i);&lt;BR /&gt;47 Button=_Button(i);&lt;BR /&gt;48 Wtloss=_Wtloss(i);&lt;BR /&gt;49 output;&lt;BR /&gt;50 end;&lt;BR /&gt;51 drop Day0_: Day3_: Day7_: i;&lt;BR /&gt;52 run;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 15:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986451#M379935</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-16T15:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986460#M379936</link>
      <description>&lt;P&gt;Too bad the source is an XLSX file and not a simple text file, like a CSV.&lt;/P&gt;
&lt;P&gt;That is because you do not have much control over how the variables are created when using PROC IMPORT (or the XLSX libname engine) when reading from an XLSX file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In an spreadsheet, like your XLSX file, each cell is independent.&amp;nbsp; But when turning a column of the spreadsheet into a variable in the SAS dataset has to make all of the cells of that column into the same type of value (numeric or character).&amp;nbsp; Since you can represent a number as a character string easily, but not the reverse, then any column that has a mix of numeric and character cells must be made as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the cell in the XLSX file literally has a period in it then it is TEXT and not a number.&lt;/P&gt;
&lt;P&gt;Perhaps you just need to convert all of those periods into empty cells instead.&amp;nbsp;&amp;nbsp; Do the same for cells that have the text NA (when that text is used to mean "not available").&amp;nbsp; Then reimport the spreadsheet and now the variables created from those columns should be numeric.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 16:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986460#M379936</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-16T16:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986461#M379937</link>
      <description>&lt;P&gt;Let's look at the first one.&lt;/P&gt;
&lt;PRE&gt;37 array _FruitWt (*) Day0_FruitWt Day3_FruitWt Day7_FruitWt ;
ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;/PRE&gt;
&lt;P&gt;And looking at those three variables you can see that one is numeric and the other two are character.&lt;/P&gt;
&lt;PRE&gt;5	Day0_FruitWt	Num	8	BEST.	 	Day0_FruitWt
10	Day3_FruitWt	Char	6	$6.	$6.	Day3_FruitWt
14	Day7_FruitWt	Char	6	$6.	$6.	Day7_FruitWt
&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Apr 2026 16:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986461#M379937</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-16T16:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986463#M379938</link>
      <description>&lt;P&gt;Thank you very much for your suggestion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I changed the variable names as you suggested (FruitWt_Day0 etc) and then modified the code to this but I still get the same errors for the array&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;data long;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; set new;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; array _FruitWt (*) FruitWt: ;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; array _Color(*) Color: ;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; array _Rind (*) Rind:;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; array _Button (*) Button:;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; array _Wtloss (*) Wtloss:;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; do i=1 to dim(_FruitWt);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label=scan(vname(_FruitWt(i)), 1, "_");&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FruitWt=_FruitWt(i);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Color=_Color(i);&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Rind=_Rind(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Button=_Button(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Wtloss=_Wtloss(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; end;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; drop _Day0: _Day3: _Day7: i;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 17:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986463#M379938</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-16T17:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986464#M379939</link>
      <description>&lt;P&gt;Thank you Tom! I think I will then try to convert to csv before importing.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 18:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986464#M379939</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-16T18:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986467#M379940</link>
      <description>&lt;P&gt;One way you can try to deal with mixed type variables is to use the VVALUEX() function.&amp;nbsp; That will allow you to pass a string with the NAME of a variable and get back a string with the VALUE of the variable.&amp;nbsp; You can then use the INPUT() function to convert that string into a number.&lt;/P&gt;
&lt;P&gt;So something like this will convert the data in to name/value pairs dataset that is actually LONG.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data actually_long;
  row+1;
  set new;
  length day 8 name $32 value 8 ;
  do day=0,3,7;
    do name='FruitWt','Color','Rind','Button','Wtloss';
      value = input(vvaluex(cats('Day',day,'_',name)),32.);
      output;
    end;
  end;
  drop Day0_: Day3_: Day7_: ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then if you want you could use PROC TRANSPOSE to make your sort of long dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=actually_long out=sort_of_long;
  by row day;
  id name;
  var value;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note: You can add the ?? modifier to the informat used in the INPUT() function call to suppress the notes in the log about invalid values such "NA" that might have been what caused the variables to be made as character.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;value = input(vvaluex(cats('Day',day,'_',name)),??32.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Apr 2026 18:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986467#M379940</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-16T18:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986469#M379941</link>
      <description>&lt;P&gt;Thank you so much for your great support Tom! I noticed that the cells with numbers on them were in different format in excel so I changed them all to the same format and then I imported the data from a csv file to sas and that solved the problem!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 18:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986469#M379941</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-16T18:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986470#M379942</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6496"&gt;@palolix&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much for your great support Tom! I noticed that the cells with numbers on them were in different format in excel so I changed them all to the same format and then I imported the data from a csv file to sas and that solved the problem!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Once you have a CSV file you can avoid using PROC IMPORT and have complete control over how the variables are created.&amp;nbsp; It is especially easy if you want all of the variables to be numeric.&amp;nbsp; This would also allow you to flip/flop the names so that the variable lists would be easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile 'myfile.csv' dsd truncover firstobs=2;
  input Test Grower Treatment FruitNr 
        FruitWt_Day0 Color_Day0 Rind_Day0 Button_Day0 
        TRT_Day3 
        FruitWt_Day3 Color_Day3 Rind_Day3 Button_Day3 
        FruitWt_Day7 Color_Day7 Rind_Day7 Button_Day7 
        Wtloss_Day3 Wtloss_Day7
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Apr 2026 19:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986470#M379942</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-16T19:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986472#M379943</link>
      <description>&lt;P&gt;This is great, thank you so much Tom! I noticed I had some issues when using proc import, but this way worked perfectly! I just added a $ after the var&amp;nbsp;TRT_day3 since it is the only one that is not numeric.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2026 20:13:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986472#M379943</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-16T20:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986476#M379945</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6496"&gt;@palolix&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This is great, thank you so much Tom! I noticed I had some issues when using proc import, but this way worked perfectly! I just added a $ after the var&amp;nbsp;TRT_day3 since it is the only one that is not numeric.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To give SAS a hint it will use to set the LENGTH of the character variable you can include an informat in the INPUT statement.&amp;nbsp; Just make sure to prefix it with the : modifier so that the INPUT statement still honors the delimiters.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input .... trt_day3 :$12. ... ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Apr 2026 02:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986476#M379945</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-17T02:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986502#M379949</link>
      <description>&lt;P&gt;Good to know, thank you so much Tom for such valuable information!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2026 16:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986502#M379949</guid>
      <dc:creator>palolix</dc:creator>
      <dc:date>2026-04-17T16:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: All variables in array list must be the same type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986521#M379955</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6496"&gt;@palolix&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much for your suggestion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I changed the variable names as you suggested (FruitWt_Day0 etc) and then modified the code to this but I still get the same errors for the array&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Changing the name of the variable does not change the variable type. So if you have a mix of character and numeric values as your error messages says then the change has absolutely no effect. The bit about naming similar variables this way is more helpful starting with reading the data initially and making sure that all the variables of the same group are of the same time. Then analysis or manipulation goes quicker.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Apr 2026 05:27:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-All-variables-in-array-list-must-be-the-same-type/m-p/986521#M379955</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2026-04-18T05:27:29Z</dc:date>
    </item>
  </channel>
</rss>

