05-09-2016 12:50 PM
I am challenging trying to create random passwords in PDFPASSWORD. It does not allow me use any of the random functions available in SAS to generate a random letters. Take for example:
The general syntax is:
PDFPASSWORD = (OPEN="PASSWORD" OWNER="PASSWORD");
When you try any mathematical functions or random function, it doesn't work, instead it returns vebatim the function instead of returning the resolved variable. For instance...
PDFPASSWORD = (OPEN="PASSWORD" OWNER=RAND(2)); your password will be RAND(2)
It does not resolve the function .
PDFPASSWORD = (OPEN="PASSWORD" OWNER=MOD(2**5-1)); your password will be MOD(2**5-1)
Can any body please help. I want to send out pdf passworded document to over 200 employees with different random generated passwords.
05-09-2016 12:56 PM
Generate the random password in a datastep and assign the value to a macro varible that is referenced in the PDFPassword options or to generate Call Execute statements to complete the whole document.
I would be tempted to use this so that I would have a dataset with the password that is available later when the file can't be opened because the password was forgotten/lost or unknown in the first place by the user.
Here's something to think about: If the random function were allowed in the code how would you know what the value was to open the file later?