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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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