BookmarkSubscribeRSS Feed
Strange_Attractor
Calcite | Level 5
I need to create an encrypted version of a string, but SAS doesn't provide SHA-1, which is required. SAS Tech Support recommended using openssl (this is on a Linux box). I'm working in EG, but have gotten the Allow XCMD option turned on.

However, now that I'm ready to submit the call, I see that the X statement (and, apparently, all its function/statement/etc. variants like SYSTEM, %SYSEXEC) just get the system return code. What I want is the string that my openssl command returns. Can anyone tell me how to make this happen?

TIA,
Steve
3 REPLIES 3
darrylovia
Quartz | Level 8
Steve,
You will need to call the SHA-1 dll directly via the MODULE family of functions and call routines. By using the SASCBTBL attribute table you could build a prototpye and have SAS via the DATA STEP pass your string and return the updated value. Once you get the hang of it using the SASCBTBL with the MODULE family of functions and call routines can be quite usefull.

The below papers are a good start.
http://www2.sas.com/proceedings/sugi30/248-30.pdf

http://www.sas.com/offices/asiapacific/sp/usergroups/snug/archive/2006/presentations/Q106Matthews.pd...

and in the SAS Online Doc
http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#/documentation/cdl...
Damien_Mather
Lapis Lazuli | Level 10

Hi Steve.

Richard DeVenezia's web page is an excellent resource too, and it has an example of the call module (Darryl's suggestion) that might be a fairly close template to what you want: it calls the win MD5 dll from sas. see

http://www.devenezia.com/downloads/sas/sascbtbl/

Let us know if this apporach helps you.

Tom
Super User Tom
Super User

Use a PIPE.

data _null_;

  infile 'openssl ...' pipe ;

  input ;

  call symputx('myvar',_infile_);

run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 696 views
  • 0 likes
  • 4 in conversation