<?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 Newbie here! Deleting rows in public SAS Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Newbie-here-Deleting-rows-in-public-SAS-Macro/m-p/466292#M118962</link>
    <description>&lt;P&gt;Hi! I am a grad student trying to analyze some food frequency questionnaires using an existing tool and publicly available codebook/SAS macro. I have only used SAS a handful of times and never for&amp;nbsp;something like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Basically, what I am trying to do (for starters) is delete the data on the SAS file I downloaded from NHANES website so I can put my data in instead. I can't even figure out how to do that. How do I delete the data in the following SAS file without messing up anything else? I coded by data in a separate excel sheet the same way the codebook (see below) codes it, but am stuck on deleting all of the rows of sample&amp;nbsp;rows (over 600 samples)&amp;nbsp;in the below file. My study only has 37.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a link to the codebook:&amp;nbsp;&lt;A href="https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.htm" target="_blank"&gt;https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is a link to the SAS file I am trying to use:&amp;nbsp;&lt;A href="https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.XPT" target="_blank"&gt;https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.XPT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 31 May 2018 00:18:56 GMT</pubDate>
    <dc:creator>moomoo11</dc:creator>
    <dc:date>2018-05-31T00:18:56Z</dc:date>
    <item>
      <title>Newbie here! Deleting rows in public SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Newbie-here-Deleting-rows-in-public-SAS-Macro/m-p/466292#M118962</link>
      <description>&lt;P&gt;Hi! I am a grad student trying to analyze some food frequency questionnaires using an existing tool and publicly available codebook/SAS macro. I have only used SAS a handful of times and never for&amp;nbsp;something like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Basically, what I am trying to do (for starters) is delete the data on the SAS file I downloaded from NHANES website so I can put my data in instead. I can't even figure out how to do that. How do I delete the data in the following SAS file without messing up anything else? I coded by data in a separate excel sheet the same way the codebook (see below) codes it, but am stuck on deleting all of the rows of sample&amp;nbsp;rows (over 600 samples)&amp;nbsp;in the below file. My study only has 37.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a link to the codebook:&amp;nbsp;&lt;A href="https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.htm" target="_blank"&gt;https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is a link to the SAS file I am trying to use:&amp;nbsp;&lt;A href="https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.XPT" target="_blank"&gt;https://wwwn.cdc.gov/Nchs/Nhanes/2003-2004/FFQRAW_C.XPT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 00:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Newbie-here-Deleting-rows-in-public-SAS-Macro/m-p/466292#M118962</guid>
      <dc:creator>moomoo11</dc:creator>
      <dc:date>2018-05-31T00:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie here! Deleting rows in public SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Newbie-here-Deleting-rows-in-public-SAS-Macro/m-p/466294#M118963</link>
      <description>&lt;P&gt;If you have data in an Excel you can just read that into SAS. You could use PROC IMPORT or just use the new XLSX libref engine.&lt;/P&gt;
&lt;P&gt;Not sure why you would need to reference any other SAS dataset to do that.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 01:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Newbie-here-Deleting-rows-in-public-SAS-Macro/m-p/466294#M118963</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-05-31T01:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie here! Deleting rows in public SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Newbie-here-Deleting-rows-in-public-SAS-Macro/m-p/466299#M118967</link>
      <description>&lt;P&gt;First you need to convert the XPT file to SAS Dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Convert XPT to SAS Dataset */
libname SAS_DS 'E:\SASUniversityEdition\SandBox\Datasets';
libname xptfile xport 'E:\SASUniversityEdition\SandBox\Files\Input\FFQRAW_C.XPT' access=readonly;

proc copy inlib=xptfile outlib=SAS_DS;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are several ways to delete rows from a dataset depending on how you want to delete them, one way is as follows&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
delete from SAS_DS.FFQRAW_C
where WTS_FFQ is null;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also there are several ways to insert data like:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/* Insert values manually */
proc sql;
insert into SAS_DS.FFQRAW_C
values (1,2,3,4,.....)
values (2,3,4,5,5....);
quit;

/* Insert values from existing table */
proc sql;
insert into SAS_DS.FFQRAW_C
select * from another_table;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 May 2018 02:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Newbie-here-Deleting-rows-in-public-SAS-Macro/m-p/466299#M118967</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-05-31T02:38:47Z</dc:date>
    </item>
  </channel>
</rss>

