<?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: order of statements within datastep in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23645#M3933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look again .. I just added it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Oct 2011 19:52:34 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-10-04T19:52:34Z</dc:date>
    <item>
      <title>order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23638#M3926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unintentionally I created code that, within 1 data step, had a set of 'input' statements &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(e.g &lt;IMG src="https://communities.sas.com/" /&gt;&lt;IMG src="https://communities.sas.com/" /&gt;&lt;/P&gt;&lt;P&gt;pat_age =&amp;nbsp;&amp;nbsp; input(pat_age, dot_or_ninetynine.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; followed by infiling the data.&amp;nbsp; As I didn't receive 'uninitilized errors' it's made me curious how SAS handles statements about variables that don't yet exist -&amp;nbsp;&amp;nbsp; in that the code for reading in raw data follows statements referring to the data.&amp;nbsp; Or the variable is created 'later' in the statements and isn't read in with the raw data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any references to explain the order of operations for statements?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that's clearer than mud,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 17:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23638#M3926</guid>
      <dc:creator>anjgupta</dc:creator>
      <dc:date>2011-10-04T17:50:19Z</dc:date>
    </item>
    <item>
      <title>order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23639#M3927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have to think that you either had another infile statement before that or that you received an error in your log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The behavior, which is executable, is defined on the lower part of the page at:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 17:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23639#M3927</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-04T17:59:08Z</dc:date>
    </item>
    <item>
      <title>order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23640#M3928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I stand corrected.&amp;nbsp; The INFILE precedes all else - but I'm still curious if/when the formatting will be applied.&amp;nbsp; Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;322&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data stout.&amp;amp;state._BirthData01 ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* data read in to become formatted data */&lt;/P&gt;&lt;P&gt;323&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length bc 8.;&lt;/P&gt;&lt;P&gt;324&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile stbirth LRECL=&amp;amp;birthreclength linesize=&amp;amp;birthlinesize&lt;/P&gt;&lt;P&gt;325&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N=&amp;amp;birthLinesPerObs missover;&lt;/P&gt;&lt;P&gt;326&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %create_code_statements(birthfmt, pramsvars) /*informats for formatting birth file */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_CODE_STATEMENTS):&amp;nbsp;&amp;nbsp; mat_age = input(mat_age, dot_or_ninetynine.);&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_CODE_STATEMENTS):&amp;nbsp;&amp;nbsp; pnc_mth = input(pnc_mth, month_pncf.);&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_CODE_STATEMENTS):&amp;nbsp;&amp;nbsp; momcig = input(momcig, momlbsf.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;327&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %create_input_string_fmt(statevars, birth)&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_INPUT_STRING_FMT):&amp;nbsp;&amp;nbsp; input #1 @0001 yy4_dob ? yy4f. @;&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_INPUT_STRING_FMT):&amp;nbsp;&amp;nbsp; if _error_ or yy4_dob=. then yy4_dob=.U ;&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_INPUT_STRING_FMT):&amp;nbsp;&amp;nbsp; _error_=0;&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_INPUT_STRING_FMT):&amp;nbsp;&amp;nbsp; input #1 @0005 b_state ? $char2. @;&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_INPUT_STRING_FMT):&amp;nbsp;&amp;nbsp; input #1 @0007 certnum ? $char6. @;&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_INPUT_STRING_FMT):&amp;nbsp;&amp;nbsp; input #1 @0013 void ? $char1. @;&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_INPUT_STRING_FMT):&amp;nbsp;&amp;nbsp; input #1 @0026 tb ? 4. @;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;328&amp;nbsp; %create_code_statements( birthcalc, pramsvars )&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (infdob and momdob created at some point here)&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_CODE_STATEMENTS):&amp;nbsp;&amp;nbsp; mat_age = year(infdob) - year(momdob);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that temporal order - will the initial lines:&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_CODE_STATEMENTS):&amp;nbsp;&amp;nbsp; mat_age = input(mat_age, dot_or_ninetynine.);&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_CODE_STATEMENTS):&amp;nbsp;&amp;nbsp; pnc_mth = input(pnc_mth, month_pncf.);&lt;/P&gt;&lt;P&gt;MPRINT(CREATE_CODE_STATEMENTS):&amp;nbsp;&amp;nbsp; momcig = input(momcig, momlbsf.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have no effect as they precede the creation of the variables to be formatted?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 18:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23640#M3928</guid>
      <dc:creator>anjgupta</dc:creator>
      <dc:date>2011-10-04T18:30:32Z</dc:date>
    </item>
    <item>
      <title>order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23641#M3929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you might find the following paper quite helpful in understanding what is going on under the hood:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi28/189-28.pdf"&gt;http://www2.sas.com/proceedings/sugi28/189-28.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 18:47:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23641#M3929</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-04T18:47:15Z</dc:date>
    </item>
    <item>
      <title>order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23642#M3930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&amp;nbsp; I'm sure the explanation is in there - might need a 'dummies' version to truly get it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 18:56:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23642#M3930</guid>
      <dc:creator>anjgupta</dc:creator>
      <dc:date>2011-10-04T18:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23643#M3931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wouldn't call the following "PDV for Dummies", but you might find it an easier read .. although I'd recommend reading both and more.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings09/136-2009.pdf"&gt;http://support.sas.com/resources/papers/proceedings09/136-2009.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 19:04:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23643#M3931</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-04T19:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23644#M3932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am not seeing the link/attachment for the 2nd recommended article.&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 19:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23644#M3932</guid>
      <dc:creator>anjgupta</dc:creator>
      <dc:date>2011-10-04T19:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: order of statements within datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23645#M3933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look again .. I just added it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2011 19:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/order-of-statements-within-datastep/m-p/23645#M3933</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-04T19:52:34Z</dc:date>
    </item>
  </channel>
</rss>

