{"id":2568,"date":"2023-07-21T17:04:42","date_gmt":"2023-07-21T17:04:42","guid":{"rendered":"https:\/\/statorials.org\/it\/sas-importa-excel\/"},"modified":"2023-07-21T17:04:42","modified_gmt":"2023-07-21T17:04:42","slug":"sas-importa-excel","status":"publish","type":"post","link":"https:\/\/statorials.org\/it\/sas-importa-excel\/","title":{"rendered":"Come importare file excel in sas (con esempio)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u00c8 possibile utilizzare <strong>proc import<\/strong> per importare rapidamente i dati da un file Excel in SAS.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Questa procedura utilizza la seguente sintassi di base:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">\/*import data from Excel file called my_data.xlsx*\/\n<\/span><span style=\"color: #000000;\"><span style=\"color: #800080;\">proc import<\/span> <span style=\"color: #3366ff;\">out<\/span> =my_data\n    <span style=\"color: #3366ff;\">datafile<\/span> =\"\/home\/u13181\/my_data.xlsx\"\n    <span style=\"color: #3366ff;\">dbms<\/span> =xlsx\n    <span style=\"color: #3366ff;\">replace<\/span> ;\n    <span style=\"color: #3366ff;\">getnames<\/span> =YES;\n<span style=\"color: #800080;\">run<\/span> ;<\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Ecco cosa fa ogni riga:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>out<\/strong> : nome da dare al dataset una volta importato in SAS<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>datafile<\/strong> : posizione del file Excel da importare<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>dbms<\/strong> : formato del file da importare<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>replace<\/strong> : sostituisce il file se esiste gi\u00e0<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>getnames<\/strong> : usa la prima riga come nomi di variabili (imposta su NO se la prima riga non contiene nomi di variabili)<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">L&#8217;esempio seguente mostra come utilizzare questa funzione nella pratica.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><b>Esempio: importare dati da un file Excel in SAS<\/b><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Supponiamo di avere il seguente set di dati in Excel:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-22796 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/excel11.jpg\" alt=\"\" width=\"458\" height=\"420\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Possiamo utilizzare il seguente codice per importare questo set di dati in SAS e chiamarlo <strong>new_data<\/strong> :<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">\/*import data from Excel file called my_data.xlsx*\/\n<\/span><span style=\"color: #000000;\"><span style=\"color: #800080;\">proc import<\/span> <span style=\"color: #3366ff;\">out<\/span> =new_data\n    <span style=\"color: #3366ff;\">datafile<\/span> =\"\/home\/u13181\/my_data.xlsx\"\n    <span style=\"color: #3366ff;\">dbms<\/span> =xlsx\n    <span style=\"color: #3366ff;\">replace<\/span> ;\n    <span style=\"color: #3366ff;\">getnames<\/span> =YES;\n<span style=\"color: #800080;\">run<\/span> ;\n\n<span style=\"color: #008000;\">\/*view dataset*\/<\/span>\n<span style=\"color: #800080;\">proc print<\/span> <span style=\"color: #3366ff;\">data<\/span> = new_data;<\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-22779 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/exporter11.jpg\" alt=\"\" width=\"136\" height=\"208\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">I dati visualizzati nell&#8217;output SAS corrispondono ai dati visualizzati nel file Excel.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Nota<\/strong> : abbiamo utilizzato <strong>getnames=YES<\/strong> durante l&#8217;importazione del file poich\u00e9 la prima riga del file Excel conteneva nomi di variabili.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Risorse addizionali<\/strong><\/span><\/h3>\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-esporta-in-excel\/\" target=\"_blank\" rel=\"noopener\">Come esportare i dati da SAS a un file Excel<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/sas-esporta-in-csv\/\" target=\"_blank\" rel=\"noopener\">Come esportare i dati da SAS a un file CSV<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c8 possibile utilizzare proc import per importare rapidamente i dati da un file Excel in SAS. Questa procedura utilizza la seguente sintassi di base: \/*import data from Excel file called my_data.xlsx*\/ proc import out =my_data datafile =&#8221;\/home\/u13181\/my_data.xlsx&#8221; dbms =xlsx replace ; getnames =YES; run ; Ecco cosa fa ogni riga: out : nome da dare [&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>Come importare file Excel in SAS (con esempio) - Statorials<\/title>\n<meta name=\"description\" content=\"Questo tutorial spiega come importare file Excel in SAS, con diversi esempi.\" \/>\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-importa-excel\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Come importare file Excel in SAS (con esempio) - Statorials\" \/>\n<meta property=\"og:description\" content=\"Questo tutorial spiega come importare file Excel in SAS, con diversi esempi.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/it\/sas-importa-excel\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-21T17:04:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/excel11.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-importa-excel\/\",\"url\":\"https:\/\/statorials.org\/it\/sas-importa-excel\/\",\"name\":\"Come importare file Excel in SAS (con esempio) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/it\/#website\"},\"datePublished\":\"2023-07-21T17:04:42+00:00\",\"dateModified\":\"2023-07-21T17:04:42+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\"},\"description\":\"Questo tutorial spiega come importare file Excel in SAS, con diversi esempi.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/it\/sas-importa-excel\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/it\/sas-importa-excel\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/it\/sas-importa-excel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Casa\",\"item\":\"https:\/\/statorials.org\/it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Come importare file excel in sas (con esempio)\"}]},{\"@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":"Come importare file Excel in SAS (con esempio) - Statorials","description":"Questo tutorial spiega come importare file Excel in SAS, con diversi esempi.","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-importa-excel\/","og_locale":"it_IT","og_type":"article","og_title":"Come importare file Excel in SAS (con esempio) - Statorials","og_description":"Questo tutorial spiega come importare file Excel in SAS, con diversi esempi.","og_url":"https:\/\/statorials.org\/it\/sas-importa-excel\/","og_site_name":"Statorials","article_published_time":"2023-07-21T17:04:42+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/excel11.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-importa-excel\/","url":"https:\/\/statorials.org\/it\/sas-importa-excel\/","name":"Come importare file Excel in SAS (con esempio) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/it\/#website"},"datePublished":"2023-07-21T17:04:42+00:00","dateModified":"2023-07-21T17:04:42+00:00","author":{"@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae"},"description":"Questo tutorial spiega come importare file Excel in SAS, con diversi esempi.","breadcrumb":{"@id":"https:\/\/statorials.org\/it\/sas-importa-excel\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/it\/sas-importa-excel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/it\/sas-importa-excel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Casa","item":"https:\/\/statorials.org\/it\/"},{"@type":"ListItem","position":2,"name":"Come importare file excel in sas (con esempio)"}]},{"@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\/2568"}],"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=2568"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/2568\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/media?parent=2568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/categories?post=2568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/tags?post=2568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}