<?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: Import modify export and set of files iteratively. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133514#M36249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please specify the FILE TYPE.&amp;nbsp; If they are text you may not need the IMPORT/EXPORT bits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Nov 2013 16:27:51 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2013-11-06T16:27:51Z</dc:date>
    <item>
      <title>Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133513#M36248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, I am new to SAS and am stuck at a point and would appreciate help.&lt;/P&gt;&lt;P&gt;I need to import 20 files(path and name stored in a dataset), change the values in a particular column and then export them each with a specified name.I am not able to do this. Please help me out here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 16:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133513#M36248</guid>
      <dc:creator>nuts</dc:creator>
      <dc:date>2013-11-06T16:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133514#M36249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please specify the FILE TYPE.&amp;nbsp; If they are text you may not need the IMPORT/EXPORT bits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 16:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133514#M36249</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-11-06T16:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133515#M36250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.csv it is&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 17:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133515#M36250</guid>
      <dc:creator>nuts</dc:creator>
      <dc:date>2013-11-06T17:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133516#M36251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you identify the fields and values that need to be changed?&amp;nbsp; If you summpy example data you will getter feeback but the basics are this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set driver;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create new ouput file name from file name in driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile dummy1 csv filevar=file-name-variable-from-driver end=eof;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file dummy2 csv filevar=new-file-name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do while(not eof);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input.....;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; something&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put ....;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 18:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133516#M36251</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-11-06T18:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133517#M36252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I created a dataset with a single column(to_be_imported) which contains the path of those 20 .csv to be imported.&lt;/P&gt;&lt;P&gt;Now, I am stuck at this step:&lt;/P&gt;&lt;P&gt;for(i=1 to 20)&lt;/P&gt;&lt;P&gt;1. Import ith csv into a dataset say work. Edit a column. Export it back with the name xyz||i.csv into a specified folder.&lt;/P&gt;&lt;P&gt;2.i=i+i+1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 03:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133517#M36252</guid>
      <dc:creator>nuts</dc:creator>
      <dc:date>2013-11-07T03:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133518#M36253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;show your work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 11:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133518#M36253</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-11-07T11:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133519#M36254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for being patient. I succeeded with the part of importing them all one by one but I have a new trouble now. In the highlighted step, VAR2 column is getting &lt;/P&gt;&lt;P&gt;replaced but its truncated. Eg: If value_after_editing = HANDWASH, only HANDWA is coming in VAR2 column. It is truncating after 6/7 chars. I tried INFORMAT but then column becomes empty. Help please!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO edit_file(dataset, value_after_editing);&lt;/P&gt;&lt;P&gt;data &amp;amp;dataset;&lt;/P&gt;&lt;P&gt;set &amp;amp;dataset;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VAR2= "&amp;amp; value_after_editing";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend edit_file;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO SCANLOOP(SCANFILE,FIELD1,FIELD2,FIELD3);&lt;/P&gt;&lt;P&gt;/* First obtain the number of */&lt;/P&gt;&lt;P&gt;/* records in DATALOG */&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;IF 0 THEN SET &amp;amp;SCANFILE NOBS=X;&lt;/P&gt;&lt;P&gt;CALL SYMPUT('RECCOUNT',X);&lt;/P&gt;&lt;P&gt;STOP;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;/* loop from one to number of */&lt;/P&gt;&lt;P&gt;/* records */&lt;/P&gt;&lt;P&gt;%DO I=1 %TO &amp;amp;RECCOUNT;&lt;/P&gt;&lt;P&gt;/* Advance to the Ith record */&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;SET &amp;amp;SCANFILE (FIRSTOBS=&amp;amp;I);&lt;/P&gt;&lt;P&gt;/* store the variables */&lt;/P&gt;&lt;P&gt;/* of interest in */&lt;/P&gt;&lt;P&gt;/* macro variables */&lt;/P&gt;&lt;P&gt;CALL SYMPUT('csv_to_imported',&amp;amp;FIELD1);&lt;/P&gt;&lt;P&gt;CALL SYMPUT('dataset_name_After_importing',&amp;amp;FIELD2);&lt;/P&gt;&lt;P&gt;CALL SYMPUT('Edited_value_in_column_2',&amp;amp;FIELD3);&lt;/P&gt;&lt;P&gt;STOP;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;/* now perform the tasks that */&lt;/P&gt;&lt;P&gt;/* wish repeated for each */&lt;/P&gt;&lt;P&gt;/* observation */&lt;/P&gt;&lt;P&gt;%import_file(&amp;amp;csv_to_imported, &amp;amp;dataset_name_After_importing);&lt;/P&gt;&lt;P&gt;%edit_file(&amp;amp;dataset_name_After_importing,&amp;amp;Edited_value_in_column_2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%END;&lt;/P&gt;&lt;P&gt;%MEND SCANLOOP;&lt;/P&gt;&lt;P&gt;/* Call SCANLOOP */&lt;/P&gt;&lt;P&gt;%SCANLOOP(DATALOG,FILENM,FIELD2,FIELD3);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 14:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133519#M36254</guid>
      <dc:creator>nuts</dc:creator>
      <dc:date>2013-11-07T14:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133520#M36255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The truncation in your example likely means the the original dataset when created is creating var2 with a length of $ 6. You may need to consider how you are creating the datasets to ensure your variables are long enough to contain the desired change values. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 16:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133520#M36255</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-11-07T16:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133521#M36256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. I checked in the original dataset. It has complete names. It's only when I pass that in a macro, it gets truncated. What to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 16:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133521#M36256</guid>
      <dc:creator>nuts</dc:creator>
      <dc:date>2013-11-07T16:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Import modify export and set of files iteratively.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133522#M36257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But I will recheck and post.Also wanted to ask if it is possible to replace an excel with an exported excel of different name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 17:07:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Import-modify-export-and-set-of-files-iteratively/m-p/133522#M36257</guid>
      <dc:creator>nuts</dc:creator>
      <dc:date>2013-11-07T17:07:18Z</dc:date>
    </item>
  </channel>
</rss>

