DATA Step, Macro, Functions and more

How to create a SAS fucntion that applies SHA-1/SHA256 algorithms for hashing of data sets fields ?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

How to create a SAS fucntion that applies SHA-1/SHA256 algorithms for hashing of data sets fields ?

 

Env'nt Server - Side

Expiration:   29SEP2062.
Grace Period:  45 days (ending 13NOV2062).
Warning Period: 55 days (ending 07JAN2063).
Operating System:   AIX 64  .
Product expiration dates:
---Base SAS Software                                                                                    29SEP2062  
---SAS/STAT                                                                                             29SEP2062  
---SAS/GRAPH                                                                                            29SEP2062  
---SAS/ETS                                                                                              14JAN2052  
---SAS/OR                                                                                               14JAN2052  
---SAS/QC                                                                                               14JAN2052  
---SAS/ASSIST                                                                                           14AUG2050  
---SAS/CONNECT                                                                                          29SEP2062  
---SAS/GIS                                                                                              14JAN2052  
---SAS Integration Technologies                                                                         29SEP2062  
---SAS/Secure 168-bit                                                                                   30MAR2063  
---SAS Enterprise Guide                                                                                 29SEP2062  
---OR OPT                                                                                               14JAN2052  
---OR PRS                                                                                               14JAN2052  
---OR IVS                                                                                               14JAN2052  
---OR LSO                                                                                               14JAN2052  
---SAS/ACCESS Interface to DB2                                                                          14AUG2051  
---SAS/ACCESS Interface to Oracle                                                                       14APR2059  
---SAS/ACCESS Interface to PC Files                                                                     29SEP2062  
---SAS/ACCESS Interface to ODBC                                                                         29SEP2062  
---SAS Workspace Server for Local Access                                                                29SEP2062  
---SAS Workspace Server for Enterprise Access                                                           29SEP2062  
---DataFlux Trans DB Driver                                                                             29SEP2062  
---SAS Framework Data Server                                                                            29SEP2062  
---Reserved for Dataflux                                                                                30MAR2063  
---SAS Add-in for Microsoft Excel                                                                       29SEP2062  
---SAS Add-in for Microsoft Outlook                                                                     29SEP2062  
---SAS Add-in for Microsoft PowerPoint                                                                  29SEP2062  
---SAS Add-in for Microsoft Word                                                                        29SEP2062  

26         
27         proc product_status;
28         run;

For Base SAS Software ...
   Custom version information: 9.3_M2
   Image version information: 9.03.01M2P080112
For SAS/STAT ...
   Custom version information: 12.1
   Image version information: 9.03.01M0P081512
For SAS/GRAPH ...
   Custom version information: 9.3_M2
For SAS/ETS ...
   Custom version information: 12.1
   Image version information: 9.03.01M0P081512
For SAS/OR ...
   Custom version information: 12.2
   Image version information: 9.03.01M0P120512
For SAS/QC ...
   Custom version information: 12.1
   Image version information: 9.03.01M0P081512
For SAS/ASSIST ...
   Custom version information: 9.3
   Image version information: 9.03.01M0P051111
For SAS/CONNECT ...
   Custom version information: 9.3_M2
For SAS/GIS ...
   Custom version information: 9.3_M1
For SAS Integration Technologies ...
   Custom version information: 9.3_M2
For SAS/ACCESS Interface to DB2 ...
   Custom version information: 9.3_M2
For SAS/ACCESS Interface to Oracle ...
   Custom version information: 9.3_M1
For SAS/ACCESS Interface to PC Files ...
   Custom version information: 9.3_M2
For SAS/ACCESS Interface to ODBC ...
   Custom version information: 9.3_M2

Env'nt Client-Side

NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M3)
NOTE: This session is executing on the X64_8PRO  platform.

NOTE: Additional host information:
X64_8PRO WIN 6.2.9200  Workstation  (that's Win10 Prof)

Client connects to server via VPN

 

SAS Community Findings

Thanks to @FriedEgg I followed his steps from the link below

https://communities.sas.com/t5/Base-SAS-Programming/Enable-SHA1-Hash-MessageDigest-in-SAS-with-Javao...

to experiment w/ his SAS code that applies SHA-1 hashing with an intention to use it.

 

To set the CLASSPATH automatically I used SAS recommendations from 

http://support.sas.com/kb/38/518.html

 

Then glued the pieces together into the SHA1_Test.sas file attached. Then I had to copy the SHA1.jar/class files in Java's CLASSPATH which I also had to use in a macro provided at

http://support.sas.com/kb/38/518.html

 

"proc JAVAINFO CLASSPATHS" points to the server's jre folder in SAS9.3

 

In my mind I have to copy the jar/class files on the above location on the server but I can't add files in the jre folder on the server b/c of lack of permissions. Running SHA1_Test.sas results to an error saying the following, which makes sense.

 

ERROR: Could not find class Sha1 at line 81 column 19.  Please ensure that the CLASSPATH is correct.

 

I'm new to SAS so this is also an educational experience.

 

Qs

Seeking advice how to determine the right CLASSPATH

Am I off in my expectations the SHA-1 SAS code can run in my case with a SAS 9.4 client and a SAS 9.3 server on the back end?

Any recommendation how else I can get a SHA-1/SHA256 function running on SAS 9.3 ?

 

Thanks in advance

S-


Accepted Solutions
Solution
‎01-29-2018 12:19 PM
Contributor
Posts: 20

Re: How to create a SAS fucntion that applies SHA-1/SHA256 algorithms for hashing of data sets field

Hi,

This post answered this previously.

 

The Gist used in the solution is here.

https://gist.github.com/FriedEgg/79ad315afa1b315e8ac3

 

 

Regards,
Cameron | Selerity

View solution in original post


All Replies
Occasional Contributor
Posts: 11

Re: How to create a SAS fucntion that applies SHA-1/SHA256 algorithms for hashing of data sets field

I'm attaching all files pertained to this request. Anything else req'd I'll be happy to add promptly upon request.

Thanks.

S-

Attachment
Solution
‎01-29-2018 12:19 PM
Contributor
Posts: 20

Re: How to create a SAS fucntion that applies SHA-1/SHA256 algorithms for hashing of data sets field

Hi,

This post answered this previously.

 

The Gist used in the solution is here.

https://gist.github.com/FriedEgg/79ad315afa1b315e8ac3

 

 

Regards,
Cameron | Selerity
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 342 views
  • 2 likes
  • 2 in conversation