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 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1076 views
  • 0 likes
  • 2 in conversation