<?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: Export based on condition of dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922154#M363142</link>
    <description>&lt;P&gt;Show your log. Copy the log and then paste that into a text box.&lt;/P&gt;
&lt;P&gt;Since you are apparently using macros you should set OPTIONS MPRINT; so the log shows details of what goes on inside the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your shown code is missing at least one %end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see anything shown in your code that attempts to filter the data set to just the observations where that variable isn't missing.Did you perhaps intend:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;%IF &amp;amp;MISSINGCOUNT &amp;gt; 0 %THEN %DO;
    %PUT &amp;amp;MISSINGCOUNT;

    %TCPWIN;
    %SYSLPUT BK_PATH = &amp;amp;BK_PATH;
    %SYSLPUT ISSUE = &amp;amp;ISSUE;

    RSUBMIT;
        %LET BKFILE = ISSUE_&amp;amp;ISSUE._BANKRUPTCY;
        PROC EXPORT DATA=ME.ALL_MEM_BKS (where=(not missing(case_nr)))
            OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
            DBMS = XLSX REPLACE;
            SHEET="BK_FILE";
        RUN;
    ENDRSUBMIT;
    SIGNOFF;

%END;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2024 17:42:44 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-03-28T17:42:44Z</dc:date>
    <item>
      <title>Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922149#M363140</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a dataset that I need to export based on a condition and can’t get it to work. I have the below code that runs but doesn’t export the right dataset. When the variable case_nr has a value for any observation then I want to export just those observations else export the whole dataset. It seems simple enough but when I test it my dataset has a record that has a value in the field case_nr it still exports everything instead of just that observation. Likewise, I would expect to receive the full dataset when none of the observations have a value in case_nr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATASET: ME.ALL_MEM_BKS&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="78"&gt;
&lt;P&gt;ACCT&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;NUMBER&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;TYPE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;AMOUNT&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;CASE_NR&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;ADDR&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;ADDR1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;ADDR2&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="78"&gt;
&lt;P&gt;123456&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;123&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;PRIMARY&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;1.25&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;123&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;LANE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="78"&gt;
&lt;P&gt;185795&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;456&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;PRIMARY&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;3.95&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;987132&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;43&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;DRIVE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="78"&gt;
&lt;P&gt;987562&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;789&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;PRIMARY&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;2.85&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;924&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;STREET&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="78"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;PROC SQL NOPRINT;
    SELECT COUNT(*) INTO :MISSINGCOUNT
    FROM ME.ALL_MEM_BKS
    WHERE CASE_NR = '';
QUIT;

%IF &amp;amp;MISSINGCOUNT &amp;gt; 0 %THEN %DO;
    %PUT &amp;amp;MISSINGCOUNT;

    %TCPWIN;
    %SYSLPUT BK_PATH = &amp;amp;BK_PATH;
    %SYSLPUT ISSUE = &amp;amp;ISSUE;

    RSUBMIT;
        %LET BKFILE = ISSUE_&amp;amp;ISSUE._BANKRUPTCY;
        PROC EXPORT DATA=ME.ALL_MEM_BKS
            OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
            DBMS = XLSX REPLACE;
            SHEET="BK_FILE";
        RUN;
    ENDRSUBMIT;
    SIGNOFF;

%END;
%ELSE %DO;
    %PUT &amp;amp;MISSINGCOUNT;

    PROC SQL NOPRINT;
        CREATE TABLE ALL_MEM_BK1 AS
        SELECT *
        FROM ME.ALL_MEM_BKS
        WHERE CASE_R IS NOT NULL;
    QUIT;

    %IF %SYSFUNC(EXIST(ALL_MEM_BK1)) %THEN %DO;
        %TCPWIN;
        %SYSLPUT BK_PATH = &amp;amp;BK_PATH;
        %SYSLPUT ISSUE = &amp;amp;ISSUE;

        RSUBMIT;
            %LET BKFILE = ISSUE_&amp;amp;ISSUE._BANKRUPTCY;
            PROC EXPORT DATA=ALL_MEM_BK1
                OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
                DBMS = XLSX REPLACE;
                SHEET="BK_FILE";
            RUN;
        ENDRSUBMIT;
        SIGNOFF;
    %END;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922149#M363140</guid>
      <dc:creator>JC411911</dc:creator>
      <dc:date>2024-03-28T17:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922153#M363141</link>
      <description>&lt;P&gt;What value do you get from %put &amp;amp;missingcount?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922153#M363141</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-28T17:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922154#M363142</link>
      <description>&lt;P&gt;Show your log. Copy the log and then paste that into a text box.&lt;/P&gt;
&lt;P&gt;Since you are apparently using macros you should set OPTIONS MPRINT; so the log shows details of what goes on inside the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your shown code is missing at least one %end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see anything shown in your code that attempts to filter the data set to just the observations where that variable isn't missing.Did you perhaps intend:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;%IF &amp;amp;MISSINGCOUNT &amp;gt; 0 %THEN %DO;
    %PUT &amp;amp;MISSINGCOUNT;

    %TCPWIN;
    %SYSLPUT BK_PATH = &amp;amp;BK_PATH;
    %SYSLPUT ISSUE = &amp;amp;ISSUE;

    RSUBMIT;
        %LET BKFILE = ISSUE_&amp;amp;ISSUE._BANKRUPTCY;
        PROC EXPORT DATA=ME.ALL_MEM_BKS (where=(not missing(case_nr)))
            OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
            DBMS = XLSX REPLACE;
            SHEET="BK_FILE";
        RUN;
    ENDRSUBMIT;
    SIGNOFF;

%END;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 17:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922154#M363142</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-28T17:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922163#M363143</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;When the variable case_nr has a value for any observation then I want to export just those observations else export the whole dataset.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;It seems simple enough ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Yes.&amp;nbsp; So why not just take the simple approach.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let's first IGNORE all of your complications of RSUBMIT blocks since that has NOTHING to do with the question.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let's forget any macro logic, as it is not needed.&amp;nbsp; Instead we just need one macro variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Which we can create with this simple data step. It will either have nothing or it will have a WHERE= dataset option.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('where',' ');
  set ME.ALL_MEM_BKS;
  where not missing(case_nr);
  call symputx('where','where=(not missing(case_nr))');
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;We can now use the WHERE macro variable in the PROC EXPORT code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC EXPORT DATA=ME.ALL_MEM_BKS(&amp;amp;where)
    OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
    DBMS = XLSX REPLACE
;
    SHEET="BK_FILE";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need to you can wrap both steps into your RSUBMIT/ENDRSUBMIT block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 18:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922163#M363143</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-28T18:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922165#M363144</link>
      <description>&lt;P&gt;I attempted to run this code but got an invalid option name &amp;amp;.&lt;/P&gt;
&lt;P&gt;PROC EXPORT DATA=ME.ALL_MEM_BKS (&amp;amp;where)&lt;BR /&gt;-&lt;BR /&gt;22&lt;BR /&gt;ERROR 22-7: Invalid option name &amp;amp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I changed the _null_ to write the dataset for testing purposes and it shows no results although I would think it would have something as there are conditions for both with a value and without in my dataset.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Test;
  call symputx('where',' ');
  set ME.ALL_MEM_BKS;
  where not missing(case_nr);
  call symputx('where','where=(not missing(case_nr))');
  stop;
run;

%TCPWIN;
    %SYSLPUT BK_PATH = &amp;amp;BK_PATH;
    %SYSLPUT ISSUE = &amp;amp;ISSUE;
    RSUBMIT;
        %LET BKFILE = ISSUE_&amp;amp;ISSUE._BANKRUPTCY;
        PROC EXPORT DATA=ME.ALL_MEM_BKS (&amp;amp;where)
            OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
            DBMS = XLSX REPLACE;
            SHEET="BK_FILE";
        RUN;
    ENDRSUBMIT;
    SIGNOFF;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Mar 2024 18:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922165#M363144</guid>
      <dc:creator>JC411911</dc:creator>
      <dc:date>2024-03-28T18:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922170#M363145</link>
      <description>&lt;P&gt;You told FRED to define the WHERE macro variable.&amp;nbsp; You then asked SAM to use the value of the WHERE macro variable that you never created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Move the data step to the place where it can be useful.&amp;nbsp; Does the dataset even exist in the other SAS session?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%TCPWIN;
%SYSLPUT BK_PATH = &amp;amp;BK_PATH;
%SYSLPUT ISSUE = &amp;amp;ISSUE;
RSUBMIT;
%LET BKFILE = ISSUE_&amp;amp;ISSUE._BANKRUPTCY;

data Test;
  call symputx('where',' ');
  set ME.ALL_MEM_BKS;
  where not missing(case_nr);
  call symputx('where','where=(not missing(case_nr))');
  stop;
run;

PROC EXPORT DATA=ME.ALL_MEM_BKS (&amp;amp;where)
    OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
    DBMS = XLSX REPLACE
;
    SHEET="BK_FILE";
RUN;

ENDRSUBMIT;
SIGNOFF;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Mar 2024 19:03:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922170#M363145</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-28T19:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922173#M363146</link>
      <description>That worked thank you for the explanation and simplifying the code. I had my macros being called in the middle rather than before my data steps. I was definitely over complicating it before. I tested with two different audiences and the results are as expected.</description>
      <pubDate>Thu, 28 Mar 2024 19:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922173#M363146</guid>
      <dc:creator>JC411911</dc:creator>
      <dc:date>2024-03-28T19:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922201#M363151</link>
      <description>&lt;P&gt;I know this is asking a lot but is it possible to use this same step but if the output is all only export certain variables but all the observations?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 20:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922201#M363151</guid>
      <dc:creator>JC411911</dc:creator>
      <dc:date>2024-03-28T20:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922205#M363152</link>
      <description>&lt;P&gt;Depends on what you mean by that.&amp;nbsp; There is also the KEEP= or DROP= dataset options that can be used to control what variables get into the PROC EXPORT step.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 21:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922205#M363152</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-28T21:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922216#M363154</link>
      <description>So ultimately I would like to keep only acct and member if there are no records in case_nr and all variables and  observations if there are records in case_nr. I tried to add them to a keep statement in addition to &amp;amp;where in the proc export step but it didn’t output just those.</description>
      <pubDate>Thu, 28 Mar 2024 22:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922216#M363154</guid>
      <dc:creator>JC411911</dc:creator>
      <dc:date>2024-03-28T22:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922221#M363156</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/371433"&gt;@JC411911&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;So ultimately I would like to keep only acct and member if there are no records in case_nr and all variables and observations if there are records in case_nr. I tried to add them to a keep statement in addition to &amp;amp;where in the proc export step but it didn’t output just those.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What did you try?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Test;
  call symputx('dsoptions','keep=acct member');
  set ME.ALL_MEM_BKS;
  where not missing(case_nr);
  call symputx('dsoptions','where=(not missing(case_nr))');
  stop;
run;

PROC EXPORT DATA=ME.ALL_MEM_BKS (&amp;amp;dsoptions)
    OUTFILE="&amp;amp;BK_PATH\&amp;amp;BKFILE..XLSX"
    DBMS = XLSX REPLACE
;
    SHEET="BK_FILE";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Mar 2024 23:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922221#M363156</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-28T23:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922225#M363158</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;I appreciate all your help that is exactly what I was looking for. I was trying to use the keep statement in the export step. I also tried using the keep statement in the set and where and that obviously didnt work. I took that out and added it to the call statement and it worked. Thanks again!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _NULL_;&lt;BR /&gt;call symputx('dsoptions','keep=ACCOUNT NUMBER');&lt;BR /&gt;set ME.ALL_MEM_BKS;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;keep account member;&lt;/STRONG&gt;&lt;BR /&gt;where not missing(case_nr);&lt;BR /&gt;call symputx('dsoptions','where=(not missing(case_nr))');&lt;BR /&gt;stop;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 01:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922225#M363158</guid>
      <dc:creator>JC411911</dc:creator>
      <dc:date>2024-03-29T01:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Export based on condition of dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922230#M363162</link>
      <description>&lt;P&gt;A KEEP statement there does nothing at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are running a data _NULL_ step NONE of the variables are "kept" since there is no dataset at all that is going to be written.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 03:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-based-on-condition-of-dataset/m-p/922230#M363162</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-29T03:49:43Z</dc:date>
    </item>
  </channel>
</rss>

