BookmarkSubscribeRSS Feed
ballardw
Super User

Couldn't find a really good place to respond to the GITHUB bits in this thread but GITHUB is blocked by my ID security folks as well as any other site that is primarily identified, using whatever tool that may be, as a "File Sharing Site".

FreelanceReinh
Jade | Level 19

@SASJedi: Thank you very much for implementing and testing these improvements so quickly. This is great.

 

However, it's only now that I realize that the URL technique doesn't work for me (SAS 9.4 TS1M2, Windows 7) if the URL uses SSL. I had tested it successfully with my own website, which does not use SSL, unlike blogs.sas.com, as it seems (note the "https" in the log message):

1    filename _d2d url 'http://blogs.sas.com/content/sastraining/files/2018/08/data2datastep.txt' debug;
2
3    data _null_;
4       infile _d2d;
5       input;
6    run;

NOTE: >>> GET /content/sastraining/files/2018/08/data2datastep.txt HTTP/1.0
NOTE: >>> Host: blogs.sas.com
NOTE: >>> Accept: */*.
NOTE: >>> Accept-Language: en
NOTE: >>> Accept-Charset: iso-8859-1,*,utf-8
NOTE: >>> User-Agent: SAS/URL
NOTE: >>>
NOTE: <<< HTTP/1.1 302 Found
NOTE: <<< Date: Thu, 09 Aug 2018 09:28:45 GMT
NOTE: <<< Server: Apache
NOTE: <<< Location: https://blogs.sas.com/content/sastraining/files/2018/08/data2datastep.txt
NOTE: <<< Content-Length: 257
NOTE: <<< Connection: close
NOTE: <<< Content-Type: text/html; charset=iso-8859-1
NOTE: <<< 
ERROR: Cannot load SSL support.
NOTE: The SAS System stopped processing this step because of errors.

Maybe "SSL support" was an optional package that I skipped when I installed SAS 9.4 in 2015. Hopefully it's included in a standard installation.

UPDATE: Indeed, I must have skipped the component "SAS/SECURE SSL" back then (assuming I wouldn't need that). According to Usage Note 15394 "SSL support is not installed by default due to trade restrictions with several countries that do not allow this protocol."

SASJedi
SAS Super FREQ

OK - this needs a solution that works worldwide. How about anonymous FTP? FTP shouldn't require any special encryption.  Would you try this for me and see if it works on your system?

filename _prg temp;
filename _d2d ftp 'data2datastep.txt' cd='/outgoing/jedi'
         user='anonymous' host='ftp.sas.com';

data _null_;
   infile _d2d;
   file _prg;
   input;
   put _infile_;
run;

%include _prg;
filename _d2d;
filename _prg;

%data2datastep(!HELP)
Check out my Jedi SAS Tricks for SAS Users
FreelanceReinh
Jade | Level 19

Great idea, @SASJedi!

 

Works like a charm, even without using _prg (as @Tom had suggested earlier):

filename _d2d ftp 'data2datastep.txt' cd='/outgoing/jedi'
         user='anonymous' host='ftp.sas.com';

%include _d2d;
filename _d2d;

%data2datastep(!HELP)

 

Tom
Super User Tom
Super User

The FTP link does not work on my SAS installation. I think that they have disabled FTP on the Unix servers where SAS is running. I believe because of security concerns we are required to use SFTP and SSH.

 

But the URL link works great.

 73         filename _url url 'http://blogs.sas.com/content/sastraining/files/2018/08/data2datastep.txt' ;
 74         filename out1 temp;
 75         %let Start=%sysfunc(datetime());
 76         %let rc1=%sysfunc(fcopy(_url,out1));
 INFO: The source fileref _URL for the FCOPY function is:
       Filename=http://blogs.sas.com/content/sastraining/files/2018/08/data2datastep.txt,
       Local Host Name=...,
       Local Host IP addr=...,
       Service Hostname Name=blogsf5.sas.com,
       Service IP addr=149.173.160.44,
       Service Name=N/A,Service Portno=443,
       Lrecl=32767,Recfm=Variable
 
 INFO: The destination fileref OUT1 for the FCOPY function is:
       Filename=.../#LN00155,
       Owner Name=...,Group Name=...,
       Access Permission=-rw-r--r--,
       Last Modified=10Aug2018:09:25:22
 
 77         %let End=%sysfunc(datetime());
 78         %put &=rc1 Elapsed Seconds=%sysevalf(&end-&start);
 RC1=0 Elapsed Seconds=0.25910997390747
FreelanceReinh
Jade | Level 19

@Tom: This is another interesting approach. On a system without SSL support the return code RC1 will be positive, but if this happens, the program could automatically resort to the FTP connection. 

art297
Opal | Level 21

@SASJedi: Didn't work on SAS UE! Here is my log:

1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         filename _prg temp;
 74         filename _d2d ftp 'data2datastep.txt' cd='/outgoing/jedi'
 75                  user='anonymous' host='ftp.sas.com';
 76         
 77         data _null_;
 78            infile _d2d;
 79            file _prg;
 80            input;
 81            put _infile_;
 82         run;
 
 NOTE: 220 FTP server ready.
 WARNING: End of file.
 ERROR: Invalid file pointer.
 NOTE: The file _PRG is:
       Filename=/tmp/SAS_work2402000040B9_localhost.localdomain/#LN00071,
       Owner Name=sasdemo,Group Name=sas,
       Access Permission=-rw-rw-r--,
       Last Modified=10Aug2018:10:53:14
 
 NOTE: 0 records were written to the file _PRG.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: DATA statement used (Total process time):
       real time           3:09.89
       cpu time            2.09 seconds

Art, CEO, AnalystFinder.com

 

SASJedi
SAS Super FREQ

OK - I'm fresh out of Wile E. Coyote ideas at the moment. Looks like if we use FTP, we have to abandon the SAS University Edition crowd. And if we use HTTP, it won't work in certain work environments and may be disabled in places outside of the US. 

Check out my Jedi SAS Tricks for SAS Users
SASJedi
SAS Super FREQ

Does PROC HTTP work for you? Try this:

filename _d2d temp;

proc http 
url='http://blogs.sas.com/content/sastraining/files/2018/08/data2datastep.txt'
out=_d2d method="get";
run;

%include _d2d;

%data2datastep(!HELP)
Check out my Jedi SAS Tricks for SAS Users
FreelanceReinh
Jade | Level 19

No, it doesn't, unfortunately:

ERROR: Unable to create secure socket layer cipher.
ERROR: Could not find extension: (tkessl)
ERROR: Unable to reestablish connection to Web server

tkessl is the name of the DLL that is missing (under Windows) if SAS/SECURE SSL is not installed (http://support.sas.com/kb/57/595.html).

 

I assume it does work with non-SSL websites.

Tom
Super User Tom
Super User

@FreelanceReinh wrote:

No, it doesn't, unfortunately:

ERROR: Unable to create secure socket layer cipher.
ERROR: Could not find extension: (tkessl)
ERROR: Unable to reestablish connection to Web server

tkessl is the name of the DLL that is missing (under Windows) if SAS/SECURE SSL is not installed (http://support.sas.com/kb/57/595.html).

 

I assume it does work with non-SSL websites.


I suspect (hope?) that your situation is unique and that most users have installed SSL support when SAS was installed.

 

In fact I suspect that many sites will begin requiring SSL usage to protect their computers and so it might be more likely that an http link will not work and an https link will work.

 

FreelanceReinh
Jade | Level 19

@Tom wrote:

I suspect (hope?) that your situation is unique and that most users have installed SSL support when SAS was installed. 


That's quite possible. Maybe also Usage Note 15394 (saying that "SSL support is not installed by default") is no longer up-to-date. I've just noticed that it has a last modified date of 2008.

BeverlyBrown
Community Manager

Hmmm...let me look into that...

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Discussion stats
  • 42 replies
  • 4998 views
  • 36 likes
  • 9 in conversation