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!

Couldn't attend SAS Innovate in person? We gotchu. Access on-demand content now!

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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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