<?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 Import csv with 2 variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591467#M15221</link>
    <description>&lt;P&gt;Hey SAS-Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm working on a programm which has to import periodical&amp;nbsp;several csv-datas. My current solution looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro imp(infile);&lt;BR /&gt;PROC IMPORT datafile = "C:\Users\..."&lt;BR /&gt;OUT=work.&amp;amp;infile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DBMS=csv REPLACE;&lt;BR /&gt;DELIMITER = ';';&lt;/P&gt;&lt;P&gt;GETNAMES=YES;&lt;/P&gt;&lt;P&gt;datarow=2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Data work.&amp;amp;infile ;&lt;BR /&gt;&amp;nbsp;set work.&amp;amp;infile ;&lt;BR /&gt;&amp;nbsp;Reporting_month = Put(Today(),YYMMN6.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend imp;&lt;BR /&gt;%imp(System1_201909)&lt;BR /&gt;%imp(System2_201909)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, it works quite good. Now i'd like to change the "201909" of the macrovariables automatically to the acctual year and date. All my attemps were not successful, so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2019 11:55:06 GMT</pubDate>
    <dc:creator>Lars45</dc:creator>
    <dc:date>2019-09-25T11:55:06Z</dc:date>
    <item>
      <title>Import csv with 2 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591467#M15221</link>
      <description>&lt;P&gt;Hey SAS-Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm working on a programm which has to import periodical&amp;nbsp;several csv-datas. My current solution looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro imp(infile);&lt;BR /&gt;PROC IMPORT datafile = "C:\Users\..."&lt;BR /&gt;OUT=work.&amp;amp;infile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DBMS=csv REPLACE;&lt;BR /&gt;DELIMITER = ';';&lt;/P&gt;&lt;P&gt;GETNAMES=YES;&lt;/P&gt;&lt;P&gt;datarow=2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Data work.&amp;amp;infile ;&lt;BR /&gt;&amp;nbsp;set work.&amp;amp;infile ;&lt;BR /&gt;&amp;nbsp;Reporting_month = Put(Today(),YYMMN6.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend imp;&lt;BR /&gt;%imp(System1_201909)&lt;BR /&gt;%imp(System2_201909)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, it works quite good. Now i'd like to change the "201909" of the macrovariables automatically to the acctual year and date. All my attemps were not successful, so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 11:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591467#M15221</guid>
      <dc:creator>Lars45</dc:creator>
      <dc:date>2019-09-25T11:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import csv with 2 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591480#M15225</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/284891"&gt;@Lars45&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%imp(System1_%sysfunc(today(),yymmn6.))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Sep 2019 12:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591480#M15225</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-09-25T12:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Import csv with 2 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591483#M15226</link>
      <description>I did not expect the solution to be so simple^^&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Wed, 25 Sep 2019 12:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591483#M15226</guid>
      <dc:creator>Lars45</dc:creator>
      <dc:date>2019-09-25T12:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Import csv with 2 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591564#M15233</link>
      <description>&lt;P&gt;Relying on Proc Import to read many files often leads to inconsistency between the variable types and lengths of character variables. As a minimum I would suggest that you add a GUESSINGROWS statement to the Proc Import code with a largish value. Better in the long run might be to write a proper data step to read that file so you can control all of the variable properties.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 14:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591564#M15233</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-25T14:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Import csv with 2 variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591637#M15238</link>
      <description>&lt;P&gt;If the text file only has two variables why are you using PROC IMPORT?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 infile 'myfile.txt' dsd dlm=';' truncover firstobs=2;
 input var1 var2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Sep 2019 17:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-csv-with-2-variables/m-p/591637#M15238</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-25T17:57:11Z</dc:date>
    </item>
  </channel>
</rss>

