<?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: else input  what? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745956#M233930</link>
    <description>&lt;P&gt;I commented the code for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;*read from data below this step;  
 infile datalines;

*reads in the first three lines with Name, City and Address;
   input 
      Name $ 1-14/
	  Address $ 1-14/
	  City $ 1-12;

      *check if City is New York and if true, read the next line into the STATE variable;
	if City = 'New York ' then input @1 State $2.;
       *reads in the next line (STATE) but does nothing with it. It is stored in the automatic variable _infile_ but is not used anywhere unless explicitly referenced;
	else input;&lt;/PRE&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#!" target="_self"&gt;documentation&lt;/A&gt; is also helpful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="xis-syntaxSimple"&gt;
&lt;DIV class="xis-syntaxLevel"&gt;&lt;SPAN class="xis-keyword"&gt;INPUT&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p0gh4pl18au9c4n1a9vlvqkcr1wj" target="_blank"&gt;specification(s)&lt;/A&gt;&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;SPAN class="xis-choice"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p090uq97qdgjxln1ayqixv0fc5q7" target="_blank"&gt;@&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="xis-choice"&gt; | &lt;A tabindex="0" href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p1pks2mvy1sq09n1b6aasltbqczv" target="_blank"&gt;@@&lt;/A&gt;&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="xis-syntaxDescription"&gt;
&lt;DIV class="xis-noArgs"&gt;
&lt;H3 class="xis-title"&gt;&lt;A id="p1hn70twzrylzdn1l6bx0kpmoudp" target="_blank"&gt;&lt;/A&gt;&lt;STRONG&gt;Without Arguments&lt;/STRONG&gt;&lt;/H3&gt;
&lt;DIV id="p1lnxo8wiyhdgrn1l4ahdh7epal8" class="xis-paragraph"&gt;The INPUT statement with no arguments is called a &lt;SPAN class="xis-userSuppliedValue"&gt;null INPUT statement&lt;/SPAN&gt;. The null INPUT statement
&lt;DIV class="xis-listUnordered"&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV id="n1367adf03545zn12sfeemcjzqf5" class="xis-item"&gt;
&lt;DIV id="n1fogqbubwciq3n18e6igu9jl3hz" class="xis-paraSimpleFirst"&gt;&lt;STRONG&gt;brings an input data record into the input buffer without creating any SAS variables&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV id="p1ug7fyzm7iftpn11ksfikvme7c8" class="xis-item"&gt;
&lt;DIV id="p07r1gjac9rgegn1f30t9nsd9bfv" class="xis-paraSimpleFirst"&gt;releases an input data record that is held by a trailing @ or a double trailing @.&lt;/DIV&gt;
&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paraSimpleFirst"&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268447"&gt;@tianerhu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
   
   infile datalines;
   input 
      Name $ 1-14/
	  Address $ 1-14/
	  City $ 1-12;
	if City = 'New York ' then input @1 State $2.;
	else input;
datalines;
Joe Conley
123 Main St.
Janesville
WI
Jane Ngyuen
555 Alpha Ave.
New York
NY
Jennifer Jason
666 Mt.Diablo
Eureka
CA
;
run;
proc print data = work.test;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What&amp;nbsp;is&amp;nbsp;the&amp;nbsp;'else&amp;nbsp;input'&amp;nbsp;mean?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if&amp;nbsp;the&amp;nbsp;city&amp;nbsp;=&amp;nbsp;New&amp;nbsp;York&amp;nbsp;then&amp;nbsp;input&amp;nbsp;NY&amp;nbsp;,&amp;nbsp;&amp;nbsp;in'&amp;nbsp;else&amp;nbsp;input'&amp;nbsp;, input&amp;nbsp;what&amp;nbsp;?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sat, 05 Jun 2021 03:17:47 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-06-05T03:17:47Z</dc:date>
    <item>
      <title>else input  what?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745955#M233929</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
   
   infile datalines;
   input 
      Name $ 1-14/
	  Address $ 1-14/
	  City $ 1-12;
	if City = 'New York ' then input @1 State $2.;
	else input;
datalines;
Joe Conley
123 Main St.
Janesville
WI
Jane Ngyuen
555 Alpha Ave.
New York
NY
Jennifer Jason
666 Mt.Diablo
Eureka
CA
;
run;
proc print data = work.test;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What&amp;nbsp;is&amp;nbsp;the&amp;nbsp;'else&amp;nbsp;input'&amp;nbsp;mean?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if&amp;nbsp;the&amp;nbsp;city&amp;nbsp;=&amp;nbsp;New&amp;nbsp;York&amp;nbsp;then&amp;nbsp;input&amp;nbsp;NY&amp;nbsp;,&amp;nbsp;&amp;nbsp;in'&amp;nbsp;else&amp;nbsp;input'&amp;nbsp;, input&amp;nbsp;what&amp;nbsp;?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 03:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745955#M233929</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-06-05T03:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: else input  what?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745956#M233930</link>
      <description>&lt;P&gt;I commented the code for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;*read from data below this step;  
 infile datalines;

*reads in the first three lines with Name, City and Address;
   input 
      Name $ 1-14/
	  Address $ 1-14/
	  City $ 1-12;

      *check if City is New York and if true, read the next line into the STATE variable;
	if City = 'New York ' then input @1 State $2.;
       *reads in the next line (STATE) but does nothing with it. It is stored in the automatic variable _infile_ but is not used anywhere unless explicitly referenced;
	else input;&lt;/PRE&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#!" target="_self"&gt;documentation&lt;/A&gt; is also helpful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="xis-syntaxSimple"&gt;
&lt;DIV class="xis-syntaxLevel"&gt;&lt;SPAN class="xis-keyword"&gt;INPUT&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p0gh4pl18au9c4n1a9vlvqkcr1wj" target="_blank"&gt;specification(s)&lt;/A&gt;&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;SPAN class="xis-choice"&gt;&lt;A tabindex="0" href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p090uq97qdgjxln1ayqixv0fc5q7" target="_blank"&gt;@&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="xis-choice"&gt; | &lt;A tabindex="0" href="https://documentation.sas.com/doc/en/vdmmlcdc/1.0/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p1pks2mvy1sq09n1b6aasltbqczv" target="_blank"&gt;@@&lt;/A&gt;&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="xis-syntaxDescription"&gt;
&lt;DIV class="xis-noArgs"&gt;
&lt;H3 class="xis-title"&gt;&lt;A id="p1hn70twzrylzdn1l6bx0kpmoudp" target="_blank"&gt;&lt;/A&gt;&lt;STRONG&gt;Without Arguments&lt;/STRONG&gt;&lt;/H3&gt;
&lt;DIV id="p1lnxo8wiyhdgrn1l4ahdh7epal8" class="xis-paragraph"&gt;The INPUT statement with no arguments is called a &lt;SPAN class="xis-userSuppliedValue"&gt;null INPUT statement&lt;/SPAN&gt;. The null INPUT statement
&lt;DIV class="xis-listUnordered"&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV id="n1367adf03545zn12sfeemcjzqf5" class="xis-item"&gt;
&lt;DIV id="n1fogqbubwciq3n18e6igu9jl3hz" class="xis-paraSimpleFirst"&gt;&lt;STRONG&gt;brings an input data record into the input buffer without creating any SAS variables&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV id="p1ug7fyzm7iftpn11ksfikvme7c8" class="xis-item"&gt;
&lt;DIV id="p07r1gjac9rgegn1f30t9nsd9bfv" class="xis-paraSimpleFirst"&gt;releases an input data record that is held by a trailing @ or a double trailing @.&lt;/DIV&gt;
&lt;DIV class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paraSimpleFirst"&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268447"&gt;@tianerhu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
   
   infile datalines;
   input 
      Name $ 1-14/
	  Address $ 1-14/
	  City $ 1-12;
	if City = 'New York ' then input @1 State $2.;
	else input;
datalines;
Joe Conley
123 Main St.
Janesville
WI
Jane Ngyuen
555 Alpha Ave.
New York
NY
Jennifer Jason
666 Mt.Diablo
Eureka
CA
;
run;
proc print data = work.test;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What&amp;nbsp;is&amp;nbsp;the&amp;nbsp;'else&amp;nbsp;input'&amp;nbsp;mean?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if&amp;nbsp;the&amp;nbsp;city&amp;nbsp;=&amp;nbsp;New&amp;nbsp;York&amp;nbsp;then&amp;nbsp;input&amp;nbsp;NY&amp;nbsp;,&amp;nbsp;&amp;nbsp;in'&amp;nbsp;else&amp;nbsp;input'&amp;nbsp;, input&amp;nbsp;what&amp;nbsp;?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 05 Jun 2021 03:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745956#M233930</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-05T03:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: else input  what?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745958#M233931</link>
      <description>&lt;P&gt;Everything Reeza said, and I added the following statement after the INPUT statements:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    	PUTLOG	"NOTE:  "  _INFILE_  State=;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which yields:&lt;/P&gt;
&lt;PRE&gt;NOTE:  WI                                                                              State= 
NOTE:  NY                                                                              State=NY
NOTE:  CA                                                                              State= &lt;/PRE&gt;
&lt;P&gt;Do you see how Wisconsin and California are present when the PUTLOG executes with _INFILE_ but are blank when PUTLOG executes with State -- but New York is present.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Null Input reads the record and moves the pointer to the next record but does NOT populate any SAS variables (i.e. "State").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 03:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745958#M233931</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-05T03:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: else input  what?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745961#M233934</link>
      <description>&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 05:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745961#M233934</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-06-05T05:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: else input  what?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745962#M233935</link>
      <description>&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 05:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/else-input-what/m-p/745962#M233935</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-06-05T05:10:12Z</dc:date>
    </item>
  </channel>
</rss>

