<?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: Problem with importating of csv file from web url in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853657#M37561</link>
    <description>&lt;P&gt;I think the important part of the Log is this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Unable to sample external file, no data in first 5 records.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That means that there appears to be nothing matching what you told Proc Import to look for.&lt;/P&gt;
&lt;P&gt;Run this and show what you get in the log:&lt;/P&gt;
&lt;PRE&gt;filename csvFile url "https://raw.githubusercontent.com/DavideGuido/SASrep/main/ab2.csv" termstr=crlf;
data _null_;
   infile csvfile;&lt;BR /&gt;   file print;
   input;
   put _infile_;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I am seeing lots of ; not commas. You told proc Import that the data is comma separated. &lt;/P&gt;
&lt;P&gt;Also it seems that there may be some malformed values, see the Id followed by 11;40 as an example.&lt;/P&gt;
&lt;PRE&gt;CODICE_FISCALE;data_cont
ID1;32
ID2;41
ID3;42
ID4;35
ID5;43
ID6;36
ID7;46
ID8;36
ID9;36
ID10;28
ID
11;40
ID12;46
ID13;39
ID14;36
&lt;/PRE&gt;</description>
    <pubDate>Fri, 13 Jan 2023 10:53:35 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-01-13T10:53:35Z</dc:date>
    <item>
      <title>Problem with importating of csv file from web url</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853621#M37557</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm running two sas codes for importing .csv file from web (below the two codes) but one is good, while the other returns an error although it is very similar (really only the .csv file and relative url is different). Is there someone is avaliable to help me and explain me the reason, please.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks in advance for any suggestion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Davide&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="monospace"&gt;/*I state the libname*/&lt;BR /&gt;libname ESERCIZI "/home/u62978465/sasuser.v94";&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and then I run the code for importing the .csv:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This code works:&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="monospace"&gt;filename csvFile url "&lt;A href="https://raw.githubusercontent.com/PacktPublishing/Mastering-SAS-Programming-for-Data-Warehousing/master/Chapter%202/Data/Chap2_1_CSV.csv" target="_blank" rel="noopener"&gt;https://raw.githubusercontent.com/PacktPublishing/Mastering-SAS-Programming-for-Data-Warehousing/master/Chapter%202/Data/Chap2_1_CSV.csv&lt;/A&gt;" termstr=crlf;&lt;BR /&gt;proc import datafile=csvFile out=esercizi.foo replace dbms=csv;&lt;BR /&gt;run;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This code does not work (just the .csv file and relative url path are changed in relation to the first code)&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="monospace"&gt;filename csvFile url "&lt;A href="https://raw.githubusercontent.com/DavideGuido/SASrep/main/ab2.csv" target="_blank" rel="noopener"&gt;https://raw.githubusercontent.com/DavideGuido/SASrep/main/ab2.csv&lt;/A&gt;" termstr=crlf;&lt;BR /&gt;proc import datafile=csvFile out=esercizi.foo_git replace dbms=csv;&lt;BR /&gt;run;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The log error is this:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;WORK.PARMS.PARMS.SLIST.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Unable to sample external file, no data in first 5 records.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2023 07:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853621#M37557</guid>
      <dc:creator>DavideGuido</dc:creator>
      <dc:date>2023-01-13T07:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importating of csv file from web url</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853657#M37561</link>
      <description>&lt;P&gt;I think the important part of the Log is this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Unable to sample external file, no data in first 5 records.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That means that there appears to be nothing matching what you told Proc Import to look for.&lt;/P&gt;
&lt;P&gt;Run this and show what you get in the log:&lt;/P&gt;
&lt;PRE&gt;filename csvFile url "https://raw.githubusercontent.com/DavideGuido/SASrep/main/ab2.csv" termstr=crlf;
data _null_;
   infile csvfile;&lt;BR /&gt;   file print;
   input;
   put _infile_;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I am seeing lots of ; not commas. You told proc Import that the data is comma separated. &lt;/P&gt;
&lt;P&gt;Also it seems that there may be some malformed values, see the Id followed by 11;40 as an example.&lt;/P&gt;
&lt;PRE&gt;CODICE_FISCALE;data_cont
ID1;32
ID2;41
ID3;42
ID4;35
ID5;43
ID6;36
ID7;46
ID8;36
ID9;36
ID10;28
ID
11;40
ID12;46
ID13;39
ID14;36
&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jan 2023 10:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853657#M37561</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-13T10:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importating of csv file from web url</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853674#M37563</link>
      <description>&lt;P&gt;Many thanks Ballardw.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just tried to run your code and the results is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;CODICE_FISCALE;data_cont
ID1;32
ID2;41
ID3;42
ID4;35
ID5;43
ID6;36
ID7;46
ID8;36
ID9;36
ID10;28
ID11;40
ID12;46
ID13;39
ID14;36
ID15
;44
ID16;35
ID17;40
ID18;36
ID19;40
ID20;39
ID1;32
ID2;36
ID3;33
ID4;44
ID5;46
ID6;61
ID7;51
ID8;30
ID9;49
ID10;33
ID11;48
ID12;36
I
D13;33
ID14;32
ID15;36
ID16;44
ID17;41
ID18;34
ID19;33
ID20;51
ID1;32
ID2;56
ID3;39
ID4;35
ID5;37
ID6;32
ID7;39
ID8;41
ID9;47
ID10;5
3
ID11;39
ID12;42
ID13;41
ID14;41
ID15;35
ID16;35
ID17;59
ID18;40
ID19;41
ID20;35
ID1;38
ID2;45
ID3;44
ID4;43
ID5;37
ID6;40
ID7;36
I
D8;41
ID9;50
ID10;46
ID11;36
ID12;55
ID13;47
ID14;45
ID15;43
ID16;42
ID17;40
ID18;44
ID19;43
ID20;38
ID1;53
ID2;36
ID3;41
ID4;42
ID5
;39
ID6;38
ID7;35
ID8;39
ID9;37
ID10;45
ID11;32
ID12;34
ID13;39
ID14;38
ID15;35
ID16;39
ID17;41
ID18;45
ID19;41
ID20;36
ID1;35
ID2;4
0
ID3;28
ID4;32
ID5;26
ID6;37
ID7;45
ID8;40
ID9;40
ID10;37
ID11;48
ID12;44
ID13;39
ID14;43
ID15;42
ID16;50
ID17;41
ID18;43
ID19;42
I
D20;37
ID1;39
ID2;39
ID3;55
ID4;44
ID5;42
ID6;38
ID7;34
ID8;37
ID9;46
ID10;33
ID11;38
ID12;42
ID13;43
ID14;50
ID15;39
ID16;37
ID17;3
8
ID18;36
ID19;37
ID20;42
ID1;29
ID2;32
ID3;50
ID4;43
ID5;44
ID6;40
ID7;37
ID8;42
ID9;45
ID10;52
ID11;47
ID12;36
ID13;31
ID14;54
ID1
5;42
ID16;49
ID17;40
ID18;37
ID19;44
ID20;41
ID1;44
ID2;41
ID3;44
ID4;51
ID5;47
ID6;40
ID7;32
ID8;48
ID9;32
ID10;29
ID11;36
ID12;39

ID13;36
ID14;49
ID15;41
ID16;47
ID17;40
ID18;40
ID19;42
ID20;28
ID1;58
ID2;44
ID3;35
ID4;29
ID5;38
ID6;34
ID7;38
ID8;41
ID9;36
ID10;
38
ID11;40
ID12;43
ID13;40
ID14;42
ID15;33
ID16;43
ID17;33
ID18;48
ID19;42
ID20;41&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; In addition, I have tried to import by adding the delimiter=";" option but it returns the same error.&lt;/P&gt;&lt;P&gt;Many thanks for the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Davide&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 11:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853674#M37563</guid>
      <dc:creator>DavideGuido</dc:creator>
      <dc:date>2023-01-13T11:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importating of csv file from web url</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853678#M37564</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

filename csvFile temp termstr=lf;
proc http url="https://raw.githubusercontent.com/DavideGuido/SASrep/main/ab2.csv" out=csvFile method=get;
run;
proc import datafile=csvFile out=foo replace dbms=csv;
delimiter=';';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1673610991649.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79357i12C00E7F31D13BB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1673610991649.png" alt="Ksharp_0-1673610991649.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 11:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853678#M37564</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-01-13T11:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importating of csv file from web url</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853688#M37567</link>
      <description>&lt;P&gt;It has worked. Perfect!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many many thanks Ksharp for helping me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Davide&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 12:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Problem-with-importating-of-csv-file-from-web-url/m-p/853688#M37567</guid>
      <dc:creator>DavideGuido</dc:creator>
      <dc:date>2023-01-13T12:13:07Z</dc:date>
    </item>
  </channel>
</rss>

