<?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: How to export and import a dataset in SAS Studio without changing format of variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911659#M40805</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427210"&gt;@varatt90&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I can and have - but my code book is becoming quite long so I would like to create a new dataset for organizational purposes. Not sure if this is the best idea but I thought it would help keep things tidy.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have a very hard time understanding how ADDING a data set REDUCES a code book. You now have to document two data sets because the second one is dependent on the first. Especially if any of the variables used to create the new ones were dropped from the new set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 15:55:58 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-01-16T15:55:58Z</dc:date>
    <item>
      <title>How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911600#M40796</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset containing 100 variables, some of which I derived based on the original variables. Due to the abundance of variables, I decided to export the comprehensive dataset into a smaller one comprising approximately 20 variables for streamlined analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Upon attempting to export and import my new dataset file as csv. file , I observed that the format of the newly created variables differs from the original ones.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, in the large dataset, Gender is formatted as BEST32. under the column "Informat":&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-01-15 at 10.24.18 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92548iD6CC47B5D865118E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-01-15 at 10.24.18 PM.png" alt="Screenshot 2024-01-15 at 10.24.18 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After exporting and importing the smaller dataset, the numeric variables become character and the format and informat columns differ.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-01-15 at 10.22.20 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92549i8430A148BA651FF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-01-15 at 10.22.20 PM.png" alt="Screenshot 2024-01-15 at 10.22.20 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How do I prevent this from happening?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 03:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911600#M40796</guid>
      <dc:creator>varatt90</dc:creator>
      <dc:date>2024-01-16T03:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911601#M40797</link>
      <description>&lt;P&gt;Why can't you just read the required columns without exporting and importing?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
  set Have (keep = Gender Grade Province);
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2024 03:51:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911601#M40797</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-16T03:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911602#M40798</link>
      <description>I can and have - but my code book is becoming quite long so I would like to create a new dataset for organizational purposes. Not sure if this is the best idea but I thought it would help keep things tidy.</description>
      <pubDate>Tue, 16 Jan 2024 03:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911602#M40798</guid>
      <dc:creator>varatt90</dc:creator>
      <dc:date>2024-01-16T03:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911603#M40799</link>
      <description>&lt;P&gt;I don't follow why exporting and importing gives you any advantage - please explain. As you have found it has changed some column types, something that doesn't happen if you just read your source dataset.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 04:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911603#M40799</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-16T04:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911605#M40800</link>
      <description>Sure! It's not an advantage in terms of analyzing the data but more so in keeping my sas file with my codes organized. I wanted to keep my original file for coding and cleaning the data and for my second file with the select variables as my analytic file. I also, will need to use other statistical software in the future to analyze my data and believe it would be easier to export my smaller dataset.</description>
      <pubDate>Tue, 16 Jan 2024 04:11:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911605#M40800</guid>
      <dc:creator>varatt90</dc:creator>
      <dc:date>2024-01-16T04:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911610#M40801</link>
      <description>&lt;P&gt;1） If your exporting data is CSV, you could try GUESSINGROWS=MAX option of PROC IMPORT.&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile='c:\temp\a\a.csv' out=a dbms=csv replace;
guessingrows=max;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;2) You could change CSV into other format ,like : ACCESS or SAV(SPSS) ,for other statistical software to use:&lt;BR /&gt;For SPSS:&lt;BR /&gt;proc export data=sashelp.class outfile='c:\temp\a\a.sav' dbms=sav replace;&lt;BR /&gt;run;&lt;BR /&gt;For Access:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Creat an empty a ACESS file "c:\temp\a\a.accdb" firstly before runing the following code*/
libname a access 'c:\temp\a\a.accdb';
proc copy in=sashelp out=a noclone;
select class;
run;
libname a clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 07:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911610#M40801</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-16T07:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911613#M40802</link>
      <description>&lt;P&gt;.csv is a text file format that doesn't preserve variable attributes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to split your process into multiple programs that you can run separately then consider to store the table in a permanent location (a folder that you defined via a libname statement). This can still be a SAS table (SAS file, .sas7bdat).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using SAS9.4 M8 or a "reasonably" recent Viya version then you could also store the data in Parquet format. Parquet has also the advantage that it stores data in a more compressed way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even with .sas7bdat there are still quite a few other software packages that can read the data - Python for example.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 08:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911613#M40802</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-16T08:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911617#M40803</link>
      <description>&lt;P&gt;To avoid changes in types, lengths and formats don't use proc import to read a csv-file, write a data step instead.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 08:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911617#M40803</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2024-01-16T08:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911626#M40804</link>
      <description>&lt;P&gt;You do&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; need to export/import the data for this, just use a KEEP= dataset option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data subset;
set have (
  keep= /* list of wanted variables */
);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2024 09:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911626#M40804</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-16T09:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to export and import a dataset in SAS Studio without changing format of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911659#M40805</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427210"&gt;@varatt90&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I can and have - but my code book is becoming quite long so I would like to create a new dataset for organizational purposes. Not sure if this is the best idea but I thought it would help keep things tidy.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have a very hard time understanding how ADDING a data set REDUCES a code book. You now have to document two data sets because the second one is dependent on the first. Especially if any of the variables used to create the new ones were dropped from the new set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 15:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-and-import-a-dataset-in-SAS-Studio-without/m-p/911659#M40805</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-01-16T15:55:58Z</dc:date>
    </item>
  </channel>
</rss>

