{"id":3975,"date":"2023-07-14T09:57:48","date_gmt":"2023-07-14T09:57:48","guid":{"rendered":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/"},"modified":"2023-07-14T09:57:48","modified_gmt":"2023-07-14T09:57:48","slug":"sas-proc-sql-enthalt","status":"publish","type":"post","link":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/","title":{"rendered":"Sas: verwendung von contains in proc sql"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Sie k\u00f6nnen den <b>CONTAINS-<\/b> Operator in der <strong>SQL PROC-<\/strong> Anweisung in SAS verwenden, um nur Zeilen zur\u00fcckzugeben, in denen eine Variable in einem Datensatz ein Zeichenfolgenmuster enth\u00e4lt.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Die folgenden Beispiele zeigen, wie der <b>CONTAINS-<\/b> Operator in der Praxis mit dem folgenden Datensatz in SAS verwendet wird<\/span> <span style=\"color: #000000;\">, der Informationen \u00fcber verschiedene Basketballspieler enth\u00e4lt:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">\/*create dataset*\/\n<\/span><span style=\"color: #800080;\">data<\/span> my_data;\n    <span style=\"color: #3366ff;\">input<\/span> team $points;\n    <span style=\"color: #3366ff;\">datalines<\/span> ;\nCavs 12\nCavs 14\nWarriors 15\nHawks 18\nMavs 31\nMavs 32\nMavs 35\nCeltics 36\nCeltics 40\n;\n<span style=\"color: #800080;\">run<\/span> ;\n\n<span style=\"color: #008000;\">\/*view dataset*\/\n<\/span><span style=\"color: #800080;\">proc print<\/span> <span style=\"color: #3366ff;\">data<\/span> =my_data;\n<\/strong><\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-31502 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/comme1.jpg\" alt=\"\" width=\"187\" height=\"275\" srcset=\"\" sizes=\"\"><\/p>\n<h2> <strong>Beispiel 1: Zeilen ausw\u00e4hlen, in denen die Variable ein Muster enth\u00e4lt<\/strong><\/h2>\n<p> <span style=\"color: #000000;\">Wir k\u00f6nnen den <strong>CONTAINS-<\/strong> Operator in <strong>PROC SQL<\/strong> verwenden, um nur Zeilen auszuw\u00e4hlen, in denen das Team das \u201eavs\u201c-Muster irgendwo im Namen enth\u00e4lt:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">\/*select all rows where team contains 'avs'*\/ \n<\/span><span style=\"color: #800080;\">proc sql<\/span> ;\n   <span style=\"color: #3366ff;\">select<\/span> *\n   <span style=\"color: #3366ff;\">from<\/span> my_data\n   <span style=\"color: #3366ff;\">where<\/span> team <span style=\"color: #3366ff;\">contains<\/span> 'avs';\n<span style=\"color: #800080;\">quit<\/span> ;<\/strong><\/span> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-31503 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/comme2.jpg\" alt=\"\" width=\"124\" height=\"179\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Beachten Sie, dass nur Zeilen zur\u00fcckgegeben werden, in denen das Team irgendwo im Namen \u201eavs\u201c enth\u00e4lt.<\/span><\/p>\n<h2> <strong>Beispiel 2: W\u00e4hlen Sie Zeilen aus, in denen die Variable eines von mehreren Mustern enth\u00e4lt<\/strong><\/h2>\n<p> <span style=\"color: #000000;\">Wir k\u00f6nnen den <strong>CONTAINS-<\/strong> Operator in <strong>PROC SQL<\/strong> verwenden, um nur die Zeilen auszuw\u00e4hlen, in denen das Team irgendwo im Namen das \u201eavs\u201c-Muster <em>oder<\/em> das \u201eics\u201c-Muster enth\u00e4lt:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">\/*select all rows where team contains 'avs' or 'ics'*\/ \n<\/span><span style=\"color: #800080;\">proc sql<\/span> ;\n   <span style=\"color: #3366ff;\">select<\/span> *\n   <span style=\"color: #3366ff;\">from<\/span> my_data\n   <span style=\"color: #3366ff;\">where<\/span> team <span style=\"color: #3366ff;\">contains<\/span> 'avs' <span style=\"color: #3366ff;\">or<\/span> team <span style=\"color: #3366ff;\">contains<\/span> 'ics';\n<span style=\"color: #800080;\">quit<\/span> ;<\/strong><\/span> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-31849 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/contient4.jpg\" alt=\"\" width=\"130\" height=\"219\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Es werden nur Zeilen zur\u00fcckgegeben, in denen das Team irgendwo im Namen \u201eavs\u201c <em>oder<\/em> \u201eics\u201c enth\u00e4lt.<\/span><\/p>\n<h2> <strong>Beispiel 3: Zeilen ausw\u00e4hlen, in denen die Variable kein Muster enth\u00e4lt<\/strong><\/h2>\n<p> <span style=\"color: #000000;\">Das Gegenteil des <strong>CONTAINS-<\/strong> Operators in <strong>PROC SQL<\/strong> ist <strong>NOT CONTAINS<\/strong> , der Zeilen ausw\u00e4hlt, in denen bestimmte Variablen in einem Datensatz <em>kein<\/em> bestimmtes Zeichenfolgenmuster enthalten.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie Sie mit dem <strong>NOT CONTAINS<\/strong> -Operator alle Zeilen ausw\u00e4hlen, deren Teamname nicht \u201eavs\u201c enth\u00e4lt:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">\/*select all rows where team does not contain 'avs'*\/\n<\/span><span style=\"color: #800080;\">proc sql<\/span> ;\n   <span style=\"color: #3366ff;\">select<\/span> *\n   <span style=\"color: #3366ff;\">from<\/span> my_data\n   <span style=\"color: #3366ff;\">where<\/span> team <span style=\"color: #3366ff;\">not contains<\/span> 'avs';\n<span style=\"color: #800080;\">quit<\/span> ;<\/strong><\/span> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-31504 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/comme3.jpg\" alt=\"\" width=\"149\" height=\"150\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Beachten Sie, dass nur Zeilen zur\u00fcckgegeben werden, in denen das Team nicht irgendwo im Namen \u201eavs\u201c enth\u00e4lt.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Zus\u00e4tzliche Ressourcen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">In den folgenden Tutorials wird erl\u00e4utert, wie Sie andere h\u00e4ufige Aufgaben in SAS ausf\u00fchren:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/de\/sas-proc-sql-union\/\" target=\"_blank\" rel=\"noopener\">SAS: So verwenden Sie UNION in PROC SQL<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/sas-proc-sql-ausser\/\" target=\"_blank\" rel=\"noopener\">SAS: So verwenden Sie EXCEPT in PROC SQL<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/sas-proc-sql-in\/\" target=\"_blank\" rel=\"noopener\">SAS: So verwenden Sie den IN-Operator in PROC SQL<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/sas-proc-sql-oder\/\" target=\"_blank\" rel=\"noopener\">SAS: So verwenden Sie den WHERE-Operator in PROC SQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sie k\u00f6nnen den CONTAINS- Operator in der SQL PROC- Anweisung in SAS verwenden, um nur Zeilen zur\u00fcckzugeben, in denen eine Variable in einem Datensatz ein Zeichenfolgenmuster enth\u00e4lt. Die folgenden Beispiele zeigen, wie der CONTAINS- Operator in der Praxis mit dem folgenden Datensatz in SAS verwendet wird , der Informationen \u00fcber verschiedene Basketballspieler enth\u00e4lt: \/*create dataset*\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SAS: Verwendung von CONTAINS in PROC SQL - Statorials<\/title>\n<meta name=\"description\" content=\"In diesem Tutorial wird erkl\u00e4rt, wie\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SAS: Verwendung von CONTAINS in PROC SQL - Statorials\" \/>\n<meta property=\"og:description\" content=\"In diesem Tutorial wird erkl\u00e4rt, wie\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-14T09:57:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/comme1.jpg\" \/>\n<meta name=\"author\" content=\"Dr. Benjamin Anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr. Benjamin Anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/\",\"url\":\"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/\",\"name\":\"SAS: Verwendung von CONTAINS in PROC SQL - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/de\/#website\"},\"datePublished\":\"2023-07-14T09:57:48+00:00\",\"dateModified\":\"2023-07-14T09:57:48+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\"},\"description\":\"In diesem Tutorial wird erkl\u00e4rt, wie\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Heim\",\"item\":\"https:\/\/statorials.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sas: verwendung von contains in proc sql\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/de\/#website\",\"url\":\"https:\/\/statorials.org\/de\/\",\"name\":\"Statorials\",\"description\":\"Ihr Leitfaden f\u00fcr statistische Kompetenz !\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de-DE\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\",\"name\":\"Dr. Benjamin Anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr. Benjamin Anderson\"},\"description\":\"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen\",\"sameAs\":[\"https:\/\/statorials.org\/de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SAS: Verwendung von CONTAINS in PROC SQL - Statorials","description":"In diesem Tutorial wird erkl\u00e4rt, wie","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/","og_locale":"de_DE","og_type":"article","og_title":"SAS: Verwendung von CONTAINS in PROC SQL - Statorials","og_description":"In diesem Tutorial wird erkl\u00e4rt, wie","og_url":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/","og_site_name":"Statorials","article_published_time":"2023-07-14T09:57:48+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/comme1.jpg"}],"author":"Dr. Benjamin Anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr. Benjamin Anderson","Gesch\u00e4tzte Lesezeit":"2 Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/","url":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/","name":"SAS: Verwendung von CONTAINS in PROC SQL - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/de\/#website"},"datePublished":"2023-07-14T09:57:48+00:00","dateModified":"2023-07-14T09:57:48+00:00","author":{"@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0"},"description":"In diesem Tutorial wird erkl\u00e4rt, wie","breadcrumb":{"@id":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/de\/sas-proc-sql-enthalt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Heim","item":"https:\/\/statorials.org\/de\/"},{"@type":"ListItem","position":2,"name":"Sas: verwendung von contains in proc sql"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/de\/#website","url":"https:\/\/statorials.org\/de\/","name":"Statorials","description":"Ihr Leitfaden f\u00fcr statistische Kompetenz !","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de-DE"},{"@type":"Person","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0","name":"Dr. Benjamin Anderson","image":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","caption":"Dr. Benjamin Anderson"},"description":"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen","sameAs":["https:\/\/statorials.org\/de"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/3975"}],"collection":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/comments?post=3975"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/3975\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/media?parent=3975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/categories?post=3975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/tags?post=3975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}