<?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: Macro Variable within an Infile Statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/541872#M149702</link>
    <description>&lt;P&gt;try this&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f4f4f4; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;INFILE '/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_'&amp;amp;LST_YR'.txt' delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2;&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f4f4f4; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;INFILE '/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_"&amp;amp;LST_YR.".txt' delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Mar 2019 22:56:42 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2019-03-10T22:56:42Z</dc:date>
    <item>
      <title>Macro Variable within an Infile Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/541871#M149701</link>
      <description>&lt;P&gt;Hi, I'm trying to create a date macro variable and then insert it into an infile statement where I'm reading in a text file.&amp;nbsp; However, I'm getting the following error.&amp;nbsp; I've read through some of the posts and see similar posts but can't find one that specifically addresses my example here.&amp;nbsp; Could you please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA _NULL_ ;&lt;BR /&gt;FORMAT CURR_YR LST_YR YEAR4.;&lt;BR /&gt;&lt;BR /&gt;CURR_YR = INTNX('YEAR',TODAY(),0);&lt;BR /&gt;LST_YR = INTNX('YEAR',TODAY(),-1);&lt;BR /&gt;&lt;BR /&gt;CALL SYMPUT('CURR_YR','"'||PUT(CURR_YR,YEAR4.)||'"');&lt;BR /&gt;&amp;nbsp; CALL SYMPUT('LST_YR','"'||PUT(LST_YR,YEAR4.)||'"');&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;%PUT&lt;BR /&gt;CURRENT YEAR: &amp;amp;CURR_YR&lt;BR /&gt;LAST YEAR: &amp;amp;LST_YR&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;INFILE '/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_'&amp;amp;LST_YR'.txt' delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOG:&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;72&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;73 DATA USER.LST_YR_VALUES (DROP=RP APPRAISAL_YEAR RECORD_TYPE SEQUENCE_NO PIDN TAD_MAP MAPSCO STATE_USE_CODE&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;73 ! NUM_SPECIAL_DIST DEED_BOOK DEED_PAGE&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;74 ARB_INDICATOR CENTRAL_HEAT_IND CENTRAL_AIR_IND STRUCTURE_COUNT FROM_ACCTS GIS_LINK INSTRUMENT_NO OVERLAP_FLAG&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75 GARAGE_CAPACITY OWNER_ZIP4);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 INFILE '/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_'&amp;amp;LST_YR'.txt' delimiter = '|' MISSOVER DSD&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 ! lrecl=32767 firstobs=2;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Line generated by the macro variable "LST_YR".&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 '/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_'"2018"&lt;/DIV&gt;&lt;DIV class="sasError"&gt;______&lt;/DIV&gt;&lt;DIV class="sasError"&gt;23&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 23-2: Invalid option name "2018".&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2019 22:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/541871#M149701</guid>
      <dc:creator>agbpilot</dc:creator>
      <dc:date>2019-03-10T22:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable within an Infile Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/541872#M149702</link>
      <description>&lt;P&gt;try this&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f4f4f4; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;INFILE '/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_'&amp;amp;LST_YR'.txt' delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2;&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f4f4f4; color: #333333; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 150%; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;INFILE '/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_"&amp;amp;LST_YR.".txt' delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2019 22:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/541872#M149702</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-03-10T22:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable within an Infile Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/541874#M149704</link>
      <description>&lt;P&gt;Here's how to include a macro variable within a text string.&amp;nbsp; Notice the extra dot, as well as double quotes instead of single quotes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;INFILE "/folders/myfolders/tarrant/input_data/prior_yr/PropertyData_R_&lt;FONT color="#FF0000"&gt;&amp;amp;LST_YR.&lt;/FONT&gt;.txt" delimiter = '|' MISSOVER DSD lrecl=32767 firstobs=2;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2019 23:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/541874#M149704</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-10T23:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Variable within an Infile Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/542985#M150081</link>
      <description>Thank you, this works!</description>
      <pubDate>Thu, 14 Mar 2019 00:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Variable-within-an-Infile-Statement/m-p/542985#M150081</guid>
      <dc:creator>agbpilot</dc:creator>
      <dc:date>2019-03-14T00:39:48Z</dc:date>
    </item>
  </channel>
</rss>

