LesezeichenAbonnierenRSS-Feed abonnieren
amelie_schroll0
Nicht anwendbar

Liebe Community.

Ich habe leider ein Problem bei der Filterung von Daten mit dem WHERE clause.

Mein Befehl im Code-Window lautet wie folgt

data mydata.filtered;

set mydata.master;

where year>2000 and ind="FIRE=" and ind="Banking";

run;

SAS  gibt mir daraufhin keine Fehlermeldung aus, aber findet leider keine Beobachtungen, obwohl die Variablennamen definitiv mit der Ursprungsdatei übereinstimmen.

Der Hinweise lautet wie folgt:

  OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 data mydata.filtered;

44 set mydata.master;

45 where year>2000 and ind="FIRE=" and ind="Banking";

46 run;

NOTE: There were 0 observations read from the data set MYDATA.MASTER.

  WHERE 0 /* eine offensichtlich FALSCHE Where-Bedingung (FALSE) */ ;

NOTE: The data set MYDATA.FILTERED has 0 observations and 22 variables.

NOTE: DATA statement used (Total process time):

  real time 0.05 seconds

  cpu time 0.03 seconds

  

47 ;

48 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

58 ;

Hat jemand schon mal das gleiche Problem gehabt und kann weiterhelfen?

Vielen Dank für die Hilfe.

Amelie

ps: Wenn ich nur den Befehl where year>2000; verwende klappt die Filterung. Mache ich mit der Syntax etwas falsch?

2 ANTWORTEN 2
BeverlyBrown
Community Manager

Hi , I moved your inquiry into the Community Deutschprachiger SAS-Programmierer und -Anwender (CoDe SAS), where you can find help in your native language. Thank you for being part of our communities!

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
BrunoMueller
SAS Super FREQ

Die Variable "ind" kann nicht gleichzeitig "FIRE=" und "Banking" enthalten. Ich gehe davon aus, dass ind "FIRE=" oder "Banking enthalten soll.

Das Where kann so aussehen:

where year>2000 and ind in ("FIRE=", "Banking");

Eventuell ist das = in "FIRE=" noch ein Tippfehler.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Diskussionsstatistiken
  • 2 Antworten
  • 1252 Aufrufe
  • 3 Kudos
  • 3 in Unterhaltung