{"id":3917,"date":"2023-07-14T19:01:55","date_gmt":"2023-07-14T19:01:55","guid":{"rendered":"https:\/\/statorials.org\/it\/sas-proc-sql-in\/"},"modified":"2023-07-14T19:01:55","modified_gmt":"2023-07-14T19:01:55","slug":"sas-proc-sql-in","status":"publish","type":"post","link":"https:\/\/statorials.org\/it\/sas-proc-sql-in\/","title":{"rendered":"Sas: come utilizzare l&#39;operatore in in proc sql"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u00c8 possibile utilizzare l&#8217;operatore <b>IN<\/b> nell&#8217;istruzione <strong>PROC SQL<\/strong> in SAS per restituire solo le righe in cui una variabile in un set di dati contiene un valore in un elenco.<\/span><\/p>\n<p> <span style=\"color: #000000;\">L&#8217;esempio seguente mostra come utilizzare in pratica l&#8217;operatore <b>IN<\/b> .<\/span><\/p>\n<h2> <strong>Esempio: utilizzo dell&#8217;operatore IN in PROC SQL in SAS<\/strong><\/h2>\n<p> <span style=\"color: #000000;\">Supponiamo di avere il seguente set di dati in SAS che contiene informazioni su vari giocatori di basket:<\/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: #000000;\"><span style=\"color: #800080;\">data<\/span> my_data;\n    <span style=\"color: #3366ff;\">input<\/span> team $points;\n    <span style=\"color: #3366ff;\">datalines<\/span> ;\nAT 12\nAt 14\nAt 15\nAt 18\nB 31\nB 32\nC 35\nC 36\nC40\nD 28\nE20\nE 21\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<\/span><\/strong><\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-31488 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/en-1.jpg\" alt=\"\" width=\"164\" height=\"351\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Possiamo utilizzare l&#8217;operatore <strong>IN<\/strong> in <strong>PROC SQL<\/strong> per selezionare solo le righe in cui team \u00e8 uguale ad A, B o E:<\/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 is A, B, or E*\/\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;\">in<\/span> ('A', 'B', 'E');\n<span style=\"color: #800080;\">quit<\/span> ;<\/strong><\/span> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-31489 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/en-2.jpg\" alt=\"\" width=\"138\" height=\"268\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Tieni presente che vengono restituite solo le righe in cui la squadra \u00e8 uguale ad A, B o E.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">L&#8217;opposto dell&#8217;operatore <strong>IN<\/strong> in <strong>PROC SQL<\/strong> \u00e8 <strong>NOT IN<\/strong> , che seleziona le righe in cui alcune variabili in un set di dati <em>non<\/em> contengono un valore in un elenco.<\/span><\/span><\/p>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come utilizzare l&#8217;operatore <strong>NOT IN<\/strong> per selezionare tutte le righe in cui team non \u00e8 uguale ad A, B o E:<\/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 is not A, B, or E*\/\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 in<\/span> ('A', 'B', 'E');\n<span style=\"color: #800080;\">quit<\/span> ;<\/strong><\/span> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-31490 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/en3.jpg\" alt=\"\" width=\"133\" height=\"154\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Tieni presente che vengono restituite solo le righe in cui la squadra non \u00e8 uguale ad A, B o E.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Risorse addizionali<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">I seguenti tutorial spiegano come eseguire altre attivit\u00e0 comuni in SAS:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/it\/sas-proc-sql-unione\/\" target=\"_blank\" rel=\"noopener\">SAS: come utilizzare UNION in PROC SQL<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/sas-proc-sql-eccetto\/\" target=\"_blank\" rel=\"noopener\">SAS: come utilizzare EXCEPT in PROC SQL<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/sas-proc-univariata-per-gruppo\/\" target=\"_blank\" rel=\"noopener\">SAS: come utilizzare Proc Univariate per gruppo<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c8 possibile utilizzare l&#8217;operatore IN nell&#8217;istruzione PROC SQL in SAS per restituire solo le righe in cui una variabile in un set di dati contiene un valore in un elenco. L&#8217;esempio seguente mostra come utilizzare in pratica l&#8217;operatore IN . Esempio: utilizzo dell&#8217;operatore IN in PROC SQL in SAS Supponiamo di avere il seguente set [&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: Come utilizzare l&#039;operatore IN in PROC SQL - Stology<\/title>\n<meta name=\"description\" content=\"Questo tutorial spiega come utilizzare l&#039;operatore IN in PROC SQL in SAS per selezionare le righe in cui una variabile specifica contiene un valore in un elenco.\" \/>\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\/it\/sas-proc-sql-in\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SAS: Come utilizzare l&#039;operatore IN in PROC SQL - Stology\" \/>\n<meta property=\"og:description\" content=\"Questo tutorial spiega come utilizzare l&#039;operatore IN in PROC SQL in SAS per selezionare le righe in cui una variabile specifica contiene un valore in un elenco.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/it\/sas-proc-sql-in\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-14T19:01:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/en-1.jpg\" \/>\n<meta name=\"author\" content=\"Benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/it\/sas-proc-sql-in\/\",\"url\":\"https:\/\/statorials.org\/it\/sas-proc-sql-in\/\",\"name\":\"SAS: Come utilizzare l&#39;operatore IN in PROC SQL - Stology\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/it\/#website\"},\"datePublished\":\"2023-07-14T19:01:55+00:00\",\"dateModified\":\"2023-07-14T19:01:55+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\"},\"description\":\"Questo tutorial spiega come utilizzare l&#39;operatore IN in PROC SQL in SAS per selezionare le righe in cui una variabile specifica contiene un valore in un elenco.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/it\/sas-proc-sql-in\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/it\/sas-proc-sql-in\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/it\/sas-proc-sql-in\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Casa\",\"item\":\"https:\/\/statorials.org\/it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sas: come utilizzare l&#39;operatore in in proc sql\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/it\/#website\",\"url\":\"https:\/\/statorials.org\/it\/\",\"name\":\"Statorials\",\"description\":\"La tua guida all&#039;alfabetizzazione statistica!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/it\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\",\"name\":\"Benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Benjamin anderson\"},\"description\":\"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9\",\"sameAs\":[\"https:\/\/statorials.org\/it\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SAS: Come utilizzare l&#39;operatore IN in PROC SQL - Stology","description":"Questo tutorial spiega come utilizzare l&#39;operatore IN in PROC SQL in SAS per selezionare le righe in cui una variabile specifica contiene un valore in un elenco.","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\/it\/sas-proc-sql-in\/","og_locale":"it_IT","og_type":"article","og_title":"SAS: Come utilizzare l&#39;operatore IN in PROC SQL - Stology","og_description":"Questo tutorial spiega come utilizzare l&#39;operatore IN in PROC SQL in SAS per selezionare le righe in cui una variabile specifica contiene un valore in un elenco.","og_url":"https:\/\/statorials.org\/it\/sas-proc-sql-in\/","og_site_name":"Statorials","article_published_time":"2023-07-14T19:01:55+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/en-1.jpg"}],"author":"Benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin anderson","Est. reading time":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/it\/sas-proc-sql-in\/","url":"https:\/\/statorials.org\/it\/sas-proc-sql-in\/","name":"SAS: Come utilizzare l&#39;operatore IN in PROC SQL - Stology","isPartOf":{"@id":"https:\/\/statorials.org\/it\/#website"},"datePublished":"2023-07-14T19:01:55+00:00","dateModified":"2023-07-14T19:01:55+00:00","author":{"@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae"},"description":"Questo tutorial spiega come utilizzare l&#39;operatore IN in PROC SQL in SAS per selezionare le righe in cui una variabile specifica contiene un valore in un elenco.","breadcrumb":{"@id":"https:\/\/statorials.org\/it\/sas-proc-sql-in\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/it\/sas-proc-sql-in\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/it\/sas-proc-sql-in\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Casa","item":"https:\/\/statorials.org\/it\/"},{"@type":"ListItem","position":2,"name":"Sas: come utilizzare l&#39;operatore in in proc sql"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/it\/#website","url":"https:\/\/statorials.org\/it\/","name":"Statorials","description":"La tua guida all&#039;alfabetizzazione statistica!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/it\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"it-IT"},{"@type":"Person","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae","name":"Benjamin anderson","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Benjamin anderson"},"description":"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9","sameAs":["https:\/\/statorials.org\/it"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/3917"}],"collection":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/comments?post=3917"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/3917\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/media?parent=3917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/categories?post=3917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/tags?post=3917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}