If it's SAS tables then security needs to be applied on OS level. You don't need a password but you just store the SAS tables (files) in a folder which is only readable by defined users/groups.
If it's a database then use an authentication domain defined in SAS Metadata and apply SAS metadata security on this domain so that that only defined users/groups can use it.
If you leave out the filename the encrypted password is written to the SAS log where you can copy and paste it wherever you like.
Please bear in mind, that leaving even encrypted passwords in files is not secure. For example, anyone can copy this password into their own SAS programs and providing they also know the user name can access databases without unencrypting the password string.
SAS Innovate 2025: Save the Date
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!