BookmarkSubscribeRSS Feed
efo4life
Calcite | Level 5

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 .

 

Another Instance...

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.

 

Thanks,

 

Efe

 

2 REPLIES 2
ballardw
Super User

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?

efo4life
Calcite | Level 5

Thanks Ballardw 

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
  • 2 replies
  • 1826 views
  • 0 likes
  • 2 in conversation