<?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: The format of the input data does not match the expected format for the variable 'VariableName in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884758#M349552</link>
    <description>&lt;P&gt;Without seeing the actual LOG, which shows code and error messages together, we can only guess. Please show us the &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; &lt;/STRONG&gt;log for this DATA step or PROC. Do not show us a part of the log for this PROC or DATA step. 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="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66123iA4EF494F9CA0F6EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your input data is supposed to be (for example) a date, and its not. That's my guess.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jul 2023 09:57:56 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-07-14T09:57:56Z</dc:date>
    <item>
      <title>The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884756#M349551</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How can I resolve the error "The format of the input data does not match the expected format for the variable 'VariableName'" in SAS programming?&lt;/SPAN&gt;&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;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 09:30:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884756#M349551</guid>
      <dc:creator>raavichouhan</dc:creator>
      <dc:date>2023-07-14T09:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884758#M349552</link>
      <description>&lt;P&gt;Without seeing the actual LOG, which shows code and error messages together, we can only guess. Please show us the &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; &lt;/STRONG&gt;log for this DATA step or PROC. Do not show us a part of the log for this PROC or DATA step. 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="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66123iA4EF494F9CA0F6EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your input data is supposed to be (for example) a date, and its not. That's my guess.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 09:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884758#M349552</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-14T09:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884763#M349555</link>
      <description>&lt;P&gt;Here is the SAS code snippet-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Create a sample input dataset */
data input_data;
  input VariableName $8.;
  datalines;
12345
ABCDE
;
run;

/* Attempt to read the input dataset with incorrect format */
data output_data;
  set input_data;
  length VariableName_num 8.;
  VariableName_num = input(VariableName, 8.);
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 10:04:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884763#M349555</guid>
      <dc:creator>raavichouhan</dc:creator>
      <dc:date>2023-07-14T10:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884764#M349556</link>
      <description>&lt;P&gt;I specifically asked to see the LOG&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 10:09:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884764#M349556</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-14T10:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884779#M349560</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/445406"&gt;@raavichouhan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here is the SAS code snippet-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/* Create a sample input dataset */
data input_data;
  input VariableName $8.;
  datalines;
12345
ABCDE
;
run;

/* Attempt to read the input dataset with incorrect format */
data output_data;
  set input_data;
  length VariableName_num 8.;
  VariableName_num = input(VariableName, 8.);
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So what exactly is your question?&lt;/P&gt;
&lt;P&gt;What number did you expect SAS to assign to VARIABLENAME_NUM when the value of variablename is 'ABCDE'?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 12:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884779#M349560</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-14T12:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884782#M349562</link>
      <description>&lt;P&gt;'ABCDE' is very clearly not a number. What did you expect?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 12:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884782#M349562</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-07-14T12:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884791#M349571</link>
      <description>&lt;P&gt;Have a go with the code below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create a sample input dataset */
data input_data;
  input VariableName $8.;
  datalines;
12345
ABCDE
;
run;

/* Attempt to read the input dataset with incorrect format */
data output_data;
  set input_data;
  length VariableName_num 8.;
  VariableName_num = input(VariableName,?? 8.);
  if (missing(VariableName_num)) then VariableName_num = ._;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Jul 2023 13:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884791#M349571</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-07-14T13:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: The format of the input data does not match the expected format for the variable 'VariableName</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884818#M349582</link>
      <description>&lt;P&gt;You really need to make sure that your examples relate to your actual question. You are asking about a message involving "expected format for the variable".&lt;/P&gt;
&lt;P&gt;Your example does not generate such a message:(and an example of what a LOG looks like)&lt;/P&gt;
&lt;PRE&gt;9    /* Attempt to read the input dataset with incorrect format */
10   data output_data;
11     set input_data;
12     length VariableName_num 8.;
13     VariableName_num = input(VariableName, 8.);
14   run;

NOTE: Invalid argument to function INPUT at line 13 column 22.
VariableName=ABCDE VariableName_num=. _ERROR_=1 _N_=2
NOTE: Mathematical operations could not be performed at the following
      places. The results of the operations have been set to missing
      values.
      Each place is given by: (Number of times) at (Line):(Column).
      1 at 13:22
NOTE: There were 2 observations read from the data set WORK.INPUT_DATA.
NOTE: The data set WORK.OUTPUT_DATA has 2 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;
&lt;P&gt;The error above is that in the input value ABCDE in no way resembles a number and the INPUT function cannot read it as such given the 8. informat. But that is an Invalid data. Not "expected format" error message.&lt;/P&gt;
&lt;P&gt;So, go back to the first request and show the LOG with the code and the specified error message so we can actually see what you did with the real problem.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/445406"&gt;@raavichouhan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here is the SAS code snippet-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/* Create a sample input dataset */
data input_data;
  input VariableName $8.;
  datalines;
12345
ABCDE
;
run;

/* Attempt to read the input dataset with incorrect format */
data output_data;
  set input_data;
  length VariableName_num 8.;
  VariableName_num = input(VariableName, 8.);
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 15:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-format-of-the-input-data-does-not-match-the-expected-format/m-p/884818#M349582</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-07-14T15:19:03Z</dc:date>
    </item>
  </channel>
</rss>

