<?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: Not getting the correct output while running the code.The code is given below .Help me fix this in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895544#M39813</link>
    <description>&lt;P&gt;One thing you need to be aware of with this forum. The forum software will reformat text pasted into the main message window. So it is possible that the data step you pasted is not what we actually see. You should post code, especially data step code reading inline data, into a text box opened on the forum using the &amp;lt;/&amp;gt; icon that appears above the main message window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will then appear set off as in &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; 's post.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Sep 2023 20:03:26 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-09-23T20:03:26Z</dc:date>
    <item>
      <title>Not getting the correct output while running the code.The code is given below .Help me fix this erro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895526#M39811</link>
      <description>&lt;P&gt;data abc;&lt;BR /&gt;input stud $35. Age;&lt;BR /&gt;cards;&lt;BR /&gt;animesh mardi 25&lt;BR /&gt;nahir sharma 26&lt;BR /&gt;agent rank 22&lt;BR /&gt;niharika ghatgey 23&lt;BR /&gt;pushpanjali kujur 22&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 07:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895526#M39811</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2023-09-23T07:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting the correct output while running the code.The code is given below .Help me fix this</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895527#M39812</link>
      <description>&lt;P&gt;When you use formatted INPUT, you have to provide enough characters in the data before the next column.&lt;/P&gt;
&lt;P&gt;All stud entries must be 35 characters long (pad with blanks).&lt;/P&gt;
&lt;P&gt;Or you use an INFILE statement with the DSD option, quotes around the stud values, and the colon modifier for the $35. informat.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
infile datalines dsd;
input stud :$35. Age;
cards;
"animesh mardi" 25
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 07:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895527#M39812</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-09-23T07:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting the correct output while running the code.The code is given below .Help me fix this</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895544#M39813</link>
      <description>&lt;P&gt;One thing you need to be aware of with this forum. The forum software will reformat text pasted into the main message window. So it is possible that the data step you pasted is not what we actually see. You should post code, especially data step code reading inline data, into a text box opened on the forum using the &amp;lt;/&amp;gt; icon that appears above the main message window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will then appear set off as in &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; 's post.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 20:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895544#M39813</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-23T20:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting the correct output while running the code.The code is given below .Help me fix this</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895546#M39814</link>
      <description>&lt;P&gt;You told it to read the first 35 bytes into the first variable.&lt;/P&gt;
&lt;P&gt;You can use the LIST statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  input ; 
  list;
cards;
animesh mardi 25
nahir sharma 26
agent rank 22
niharika ghatgey 23
pushpanjali kujur 22
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to see a nice listing that shows why that cannot work for the data you posted.&lt;/P&gt;
&lt;PRE&gt;RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
675        animesh mardi 25
676        nahir sharma 26
677        agent rank 22
678        niharika ghatgey 23
679        pushpanjali kujur 22
NOTE: DATA statement used (Total process time):
&lt;/PRE&gt;
&lt;P&gt;If you want your code to work the data need to look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*---+----1----+----2----+----3----+----4-;
cards;
animesh mardi                      25
nahir sharma                       26
agent rank                         22
niharika ghatgey                   23
pushpanjali kujur                  22
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could add the : modifier to the input statement so that it only uses the informat to GUESS what length you wanted to define the variable.&amp;nbsp; But you would still need to also add the &amp;amp; modifier and change the data to have two spaces after the string (and not have two spaces embedded in the string).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
  input stud &amp;amp; :$35. Age;
cards;
animesh mardi  25
nahir sharma  26
agent rank  22
niharika ghatgey  23
pushpanjali kujur  22
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also change the data to use something other than space are the delimiter and add an INFILE statement to tell SAS to use that delimiter.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
  infile cards dlm='|';
  input stud :$35. Age;
cards;
animesh mardi|25
nahir sharma|26
agent rank|22
niharika ghatgey|23
pushpanjali kujur|22
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Sep 2023 20:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Not-getting-the-correct-output-while-running-the-code-The-code/m-p/895546#M39814</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-23T20:27:44Z</dc:date>
    </item>
  </channel>
</rss>

