07-18-2017 11:03 AM
Thank you for the the previous reply for my question on How to Run Shell Script inside SAS?
I tried using the following piece of code but would like to describe my issue in detail
filename oscmd pipe "/users/smith/report.sh 2>&1"; data _null_; infile oscmd; input; put _infile_; run; filename oscmd clear;
The main purpose of running the shell script is to decrypt a particular variable within SAS.
Let me be clear.
I have a database_test in which I have a particular table Table_ABC which contains the var1 that has the encrypted value.
I need to read this encrypted_value using SAS and then put it into the shell script inside SAS to get the decrypted_value and store it in another variable var2 in the same database_test .
In short I need to do all this decryption process from within the SAS.
As I am a beginner to SAS I dont know how to approach this situation .
Thanks in advance
07-19-2017 12:24 AM
You are talking about 2 different, independent problems:
- seeing the result of a system command in SAS
- decrypting an encrypted variable
What do these 2 questions have to do with each other? What is the actual problem you want solved?
07-19-2017 09:22 AM
Thank you for your reply.
- I asked if it is possible to run shell script is because the library used for the encryption of the variable is a simple wrapper for the standard ruby OpenSSL library. Since I do not want to use ruby inside my SAS I converted them into a shell script without any ruby libraries and want to run it on SAS.
-Now for decryption-- I need to pass the encrypted value into my shell script and get the decrypted output from inside SAS itself.
This is the actual problem that I need to get solved
07-19-2017 05:56 PM
Can you just decrypt everything ahead of running the SAS program? That would simplify things a lot and would likely be substantially faster than an entry by entry decryption as well.
07-19-2017 06:01 PM
I think you're going to have to extract the encrypted value from your SAS data set and pass that as a parameter to your shell script, have the output written to a file then read that back into SAS.
I must say if the variable has to be encrypted it must be confidential and none of this process seems terribly secure to me.
07-19-2017 06:12 PM
So you need something like this?
data WANT; set TABLEABC; FILEVAR='/users/smith/decrypt.sh '||VAR1; infile DUMMY pipe filevar=FILEVAR; input; put _infile_; run;
where your script reads an ecrypted value and writes back a decrypted value.