<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Import a csv file into memory and then into report in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783022#M1250</link>
    <description>&lt;P&gt;yes I am using Sas Viya.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to&amp;nbsp;&lt;SPAN&gt;move the SAS7BAT file that PROC IMPORT created into the viya's memory as you suggested. I tried "Sas Explorer" -&amp;gt; "import tab" and I selected folder as data source, however I cannot see the location of&amp;nbsp;SAS7BAT file which is&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/home/myemail@gmail.com&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Moreover, I tried to import the csv file into a different folder:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename csvFile url "&lt;A href="https://somewebsite.com/file.csv" target="_blank" rel="nofollow noopener noreferrer"&gt;https://somewebsite.com/file.csv&lt;/A&gt;";&lt;BR /&gt;libname dbgroup '/Users';&lt;/P&gt;&lt;P&gt;proc import datafile=csvFile out=dbgroup.file1 replace dbms=csv;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but I receive the following error:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;ERROR: Library&amp;nbsp;dbgroup&amp;nbsp;does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;isn't there any solution that imports the URL of CSV directly to Viya? Especially considering that if it is a scheduled task, then two steps need to be performed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 21:48:35 GMT</pubDate>
    <dc:creator>jejobo2340</dc:creator>
    <dc:date>2021-11-29T21:48:35Z</dc:date>
    <item>
      <title>Import a csv file into memory and then into report</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/782968#M1248</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am very new to SAS and I have a question:&lt;/P&gt;&lt;P&gt;I want to simply upload a CSV file in memory and then show it in a report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already wrote a code for it using an import proc:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename csvFile url "&lt;A href="https://somewebsite.com/file.csv" target="_blank"&gt;https://somewebsite.com/file.csv&lt;/A&gt;";&lt;BR /&gt;libname dbgroup '/home/myusername@gmail.com';&lt;/P&gt;&lt;P&gt;proc import datafile=csvFile out=dbgroup.file1 replace dbms=csv;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see the table loaded in "dbgroup" but it is not shown in the list of in memory tables to which a report has access.&lt;/P&gt;&lt;P&gt;So my question is how can I load this table in memory so that I can use it in my report?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 18:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/782968#M1248</guid>
      <dc:creator>jejobo2340</dc:creator>
      <dc:date>2021-11-29T18:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Import a csv file into memory and then into report</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/782969#M1249</link>
      <description>&lt;P&gt;What do you mean by "in memory"?&amp;nbsp; Are you using VIYA?&amp;nbsp; If so you need to do something to move the SAS7BAT file that PROC IMPORT created into the viya's memory.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 18:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/782969#M1249</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-29T18:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import a csv file into memory and then into report</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783022#M1250</link>
      <description>&lt;P&gt;yes I am using Sas Viya.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to&amp;nbsp;&lt;SPAN&gt;move the SAS7BAT file that PROC IMPORT created into the viya's memory as you suggested. I tried "Sas Explorer" -&amp;gt; "import tab" and I selected folder as data source, however I cannot see the location of&amp;nbsp;SAS7BAT file which is&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/home/myemail@gmail.com&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Moreover, I tried to import the csv file into a different folder:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename csvFile url "&lt;A href="https://somewebsite.com/file.csv" target="_blank" rel="nofollow noopener noreferrer"&gt;https://somewebsite.com/file.csv&lt;/A&gt;";&lt;BR /&gt;libname dbgroup '/Users';&lt;/P&gt;&lt;P&gt;proc import datafile=csvFile out=dbgroup.file1 replace dbms=csv;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but I receive the following error:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;ERROR: Library&amp;nbsp;dbgroup&amp;nbsp;does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;isn't there any solution that imports the URL of CSV directly to Viya? Especially considering that if it is a scheduled task, then two steps need to be performed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 21:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783022#M1250</guid>
      <dc:creator>jejobo2340</dc:creator>
      <dc:date>2021-11-29T21:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Import a csv file into memory and then into report</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783032#M1251</link>
      <description>&lt;P&gt;Looking at this page&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Six-Easy-Ways-to-Import-Local-SAS-Data-Sets-into-CAS-SAS-Viya-3/ta-p/671255" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Six-Easy-Ways-to-Import-Local-SAS-Data-Sets-into-CAS-SAS-Viya-3/ta-p/671255&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It seems you need to run code like this to load a dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc casutil ;
load data=dbgroup.file1
  outcaslib="casuser" casout="&amp;amp;gateuserid._DATA_file1" copies=0 replace
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Nov 2021 22:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783032#M1251</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-29T22:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Import a csv file into memory and then into report</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783082#M1252</link>
      <description>&lt;P&gt;I wrote the following code that ends without any error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");

filename csvFile url "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-regioni/dpc-covid19-ita-regioni-latest.csv";
libname covid '/home/myusername@gmail.com';

proc import datafile=csvFile out=covid.regioni replace dbms=csv;
run;

proc casutil ;
load data=covid.regioni
  outcaslib="casuser" casout="myusername@gmail.com.regionicas" copies=0 replace
;
quit;

&lt;/PRE&gt;&lt;P&gt;"proc import" creates regioni table.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;but still I don't see&amp;nbsp;regionicas table any where in in-memory tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66240iDC883576730B85A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;any hint how can I fix it?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 08:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783082#M1252</guid>
      <dc:creator>jejobo2340</dc:creator>
      <dc:date>2021-11-30T08:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Import a csv file into memory and then into report</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783093#M1253</link>
      <description>&lt;P&gt;I moved this to the Viya community.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 09:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783093#M1253</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-30T09:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Import a csv file into memory and then into report</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783160#M1256</link>
      <description>&lt;P&gt;I think you need to save/promote the table so you can see it there:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Start a CAS session */
cas casauto sessopts=(caslib="casuser");

/* Store the CSV to a temp file. */
filename scrdata temp;
proc http
   url='https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-regioni/dpc-covid19-ita-regioni-latest.csv'
   out=scrdata;                                     
run;

/* Drop the existing table if present. */
proc casutil;
droptable casdata="covdata" incaslib="casuser";
quit;

/* Upload the CSV to CAS. */
proc cas;
   upload
      path="%sysfunc(pathname(scrdata))"
      casOut={caslib="casuser", name="covdata"}
      importOptions="csv";
run;

   table.tableInfo /
      caslib="casuser", 
      table="covdata";
quit;

/* One of the column names was over 32 characters so fix that.  */
proc casutil;

   altertable casdata="covdata"  
      columns = 
        {
          {name= "totale_positivi_test_antigenico_rapido" rename="totale_pos_test_antigen_rapido"}
        };

/* Save the file in casuser and promote the table. */
	save casdata="covdata" replace;
	promote casdata="covdata" incaslib="casuser";
quit;

/* Remove the temp file. */
filename scrdata clear;
/* End the cas session */
cas casauto terminate;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Nov 2021 15:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Import-a-csv-file-into-memory-and-then-into-report/m-p/783160#M1256</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-11-30T15:07:35Z</dc:date>
    </item>
  </channel>
</rss>

