<?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: importing data and create reject file base on condition o value of certain variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686044#M208112</link>
    <description>&lt;P&gt;You can do this with multiple datasets on the data line and conditional output statements. Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data goodshoes badshoes;
  set sashelp.shoes;
  badstoreflag = 0;
  if sales &amp;lt; 5000 then badstoreflag = 1;
  else if sales &amp;lt; 10000 then badstoreflag = 2;
  if badstoreflag = 0 then output goodshoes;
  else output badshoes;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Sep 2020 13:52:13 GMT</pubDate>
    <dc:creator>CurtisMackWSIPP</dc:creator>
    <dc:date>2020-09-23T13:52:13Z</dc:date>
    <item>
      <title>importing data and create reject file base on condition o value of certain variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686032#M208107</link>
      <description>&lt;P&gt;Hi everyone, hope you're ok!&lt;/P&gt;&lt;P&gt;I have a question for a work I am just doing:&lt;/P&gt;&lt;P&gt;I want to create 2 data set (appel and appel_rejet)&lt;/P&gt;&lt;P&gt;appel is my normal dataset if none of (Id_Client Date_appel&amp;nbsp; Id_Direction Id_Distance&amp;nbsp;) is missing and appel_rejet is a data of reject value if the line contains null value for :&lt;/P&gt;&lt;P&gt;Id_Client Date_appel&amp;nbsp; Id_Direction Id_Distance&amp;nbsp; and want to add a column in appel_rejet to show the raison of reject value.&lt;/P&gt;&lt;P&gt;data attached ...&lt;/P&gt;&lt;P&gt;Can anyone help me ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 13:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686032#M208107</guid>
      <dc:creator>KOUAME</dc:creator>
      <dc:date>2020-09-23T13:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: importing data and create reject file base on condition o value of certain variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686044#M208112</link>
      <description>&lt;P&gt;You can do this with multiple datasets on the data line and conditional output statements. Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data goodshoes badshoes;
  set sashelp.shoes;
  badstoreflag = 0;
  if sales &amp;lt; 5000 then badstoreflag = 1;
  else if sales &amp;lt; 10000 then badstoreflag = 2;
  if badstoreflag = 0 then output goodshoes;
  else output badshoes;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Sep 2020 13:52:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686044#M208112</guid>
      <dc:creator>CurtisMackWSIPP</dc:creator>
      <dc:date>2020-09-23T13:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: importing data and create reject file base on condition o value of certain variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686295#M208212</link>
      <description>thanks! will try it !</description>
      <pubDate>Thu, 24 Sep 2020 07:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686295#M208212</guid>
      <dc:creator>KOUAME</dc:creator>
      <dc:date>2020-09-24T07:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: importing data and create reject file base on condition o value of certain variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686299#M208215</link>
      <description>&lt;P&gt;Not fully tested, remove datalines and change the infile-statement according to your environment:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data appel(drop=reason) appel_rejet;
   attrib 
      Id_Client length=$ 10
      Date_appel length=8 format=yymmddd10. informat=yymmdd10.      
      Heure_appel length=8 format=time5. informat=time.
      No_appelant length=$ 20
      No_appele length=$ 20
      Id_Direction length= 8
      Id_Produit length= 8
      Id_Distance length= 8
      Duree length= 8
      Reason length= $ 130
      _var length= $ 32
      _value length= $20
   ;
   
   drop _var _value;

   infile datalines missover delimiter='|';
   input Id_Client Date_appel Heure_appel No_appelant No_appele Id_Direction Id_Produit Id_Distance Duree;
   
   /* Id_Client Date_appel  Id_Direction Id_Distance */
   if not missing(Id_Client) and nmiss(Date_appel, Id_Direction, Id_Distance) = 0 then do;
      output appel;
   end;
   else do;
      do _Var = 'Id_Client', 'Date_appel', 'Id_Direction', 'Id_Distance';
         _value = compress(vvaluex(_Var), '.');
         if missing(_value) then do;
            Reason = catx(', ', Reason, _Var);
         end;
      end;
      
      output appel_rejet;
   end;
   
datalines;
224688|2003-01-03|15:39|0548967125|0666778899|1|1|3|78
224688|2003-01-08|15:52|0612312345|0666778899|1|2|1|1
224688|2003-01-09|23:00|0666778899|0548967125|2|1|4|150
224688|2003-01-11|16:28|0666778899|0614759648|2|2|2|1
224688|2003-01-15|02:30|0666778899|0548967125|2|3|3|1
224688|2003-01-18|04:01|0666778899|0612312345|2|1|1|135
355557|2003-01-24|16:02|0615151515|0655446655|1|1|1|256
355557|2003-01-26|10:50|0664972835|0655446655|1|1|2|948
355557|2003-01-18|01:03|0664972844|0655446655|1|2|2|1
355557|2003-01-30| |0655446655|+4946497|2|1|5|145
958462|2003-01-24|05:23|0699887766|0247965814|2|3|4|1
958462|2003-01-27|23:18|0612312345|0699887766|1|1|1|248
121212|2003-01-01|11:04|06046728913|0612312345|1|1|2|648
121212|2003-01-14|15:39|0646728914|0612312345|1|2|2|1
121212|2003-01-23|15:43|0612312345|0627273838|2|1|1|254
121212|2003-01-28|23:23|0612312345|+415548967|2|3|5|1
773377|2003-01-02|18:02|0627273838|0611223344|1|1|1|694
876543|2003-01-13|04:13|0635483548|0622446688|1|1|2|425
876543|2003-01-16|07:57|0627273838|0622446688|1|1|1|348
876543|2003-01-16|21:29|0622446688|0635483548|2|1|2|648
876543|2003-01-22|16:26|0622446688|+33145784875|2|3|5|1
876543|2003-01-05|10:42|0622446688|0627273838|2|1|1|248
876543|2003-01-31|18:31|0622446688|0635483548|2|1|2|1045
876543|2003-01-24|04:27|0622446688|0627273838|3|2| |1
876543|2003-01-16|23:30|0627273838|0622446688|1| |1|1
876543|2003-01-18|11:53|0635483548|0622446688|1|1|2|318
654321|2003-01-07|16:04|+49487569|0611223344|1|1|5|648
654321|2003-01-04|17:40|0699887766|0611223344|1|2|1|1
654321|2003-01-19|01:48|0699887766|0611223344|1|1|1|964
654321|2003-01-21|20:26|1645889545|0611223344|1|1|1|478
654321|2003-01-06|08:11|0611223344|0654789658|2|1|2|1845
654321|2003-01-13|10:42|0611223344|0664849452|2|2|2|1
654321|2003-01-16|01:43|0611223344|0345784875|2|3|4|1
654321|2003-01-24|18:43|0611223344|0699887766|2|1|1|314
654321|2003-01-26|01:12|0611223344|0645889545|2|1|1|695
654321|2003-01-17|11:06|0611223344|0654789658|2|1|2|148
654321|2003-01-22|06:19|0611223344|0345784875|2|3|4|1
654321|2003-01-15|23:43|0622446688|0611223344|1|1|1|318
654321|2003-01-20|12:43|0622446688|0611223344|1|1|1|648
444333|2003-01-18|18:13|0684758475|0615151515|1| |2|145
444333|2003-01-29|18:45|0684758476|0615151515|1|2|2|1
444333|2003-01-12|04:39|0684758477|0615151515|1|1|2|364
444333|2003-01-15|22:55|+457894875|0615151515|1|1|5|1520
444333|2003-01-18|11:06|0214578946|0615151515|1|1|3|648
444333|2003-01-24|11:52|0664648585|0615151515|1|2|2|1
444333| | |0615151515|0214578946| | |3|315
666999| |18:27|0664648585|0669696969|1|1|2|348
234555|2003-01-22|18:03|0612345678|0214579468|2|3|4|1
234555|2003-01-18|04:57|0612345678|0622446688|2|1|1|648
234555|2003-01-26|08:59|0612345678|1622446688|2|1|1|695
234555|2003-01-04|22:32|0612345678|0697154863|2|1| |842
234555| |08:36|0612345678|0645798524|2|1| |3641
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Sep 2020 08:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686299#M208215</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-09-24T08:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: importing data and create reject file base on condition o value of certain variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686308#M208219</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;DIV class="sas-author-username"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475" target="_blank" rel="noopener"&gt;@andreas_lds&lt;/A&gt;&lt;/DIV&gt;&lt;DIV class="sas-author-rank"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Sep 2020 09:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686308#M208219</guid>
      <dc:creator>KOUAME</dc:creator>
      <dc:date>2020-09-24T09:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: importing data and create reject file base on condition o value of certain variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686312#M208222</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475" target="_blank" rel="noopener"&gt;@andreas_lds&lt;/A&gt;&amp;nbsp;, thanks so much , it works perfectly &lt;span class="lia-unicode-emoji" title=":smiling_face_with_heart_eyes:"&gt;😍&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":man_dancing:"&gt;🕺&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 09:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-and-create-reject-file-base-on-condition-o-value/m-p/686312#M208222</guid>
      <dc:creator>KOUAME</dc:creator>
      <dc:date>2020-09-24T09:33:17Z</dc:date>
    </item>
  </channel>
</rss>

