BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phuels
Fluorite | Level 6

Hello,

 

I currently use an abbreviation macro to insert my connection string when writing a new program. Recently, my company turned on validation, so I now need to enter a user id and password when creating the data connection.

 

I modified the abbreviation macro to include the necessary references:

proc sql outobs=;
connect to db2 (database='ACTDM5' user=&_CLIENTUSERID password=&User_Password);

The User_Password variable comes from a prompt I created using the Prompt Manager.

 

Is there a way to automatically associate the prompt when creating a new program? If so, how would I do this?

 

Thanks for your help.

 

-Frank

1 ACCEPTED SOLUTION

Accepted Solutions
tomrvincent
Rhodochrosite | Level 12
What I do is have a egp template that has an autoexec program with the password prompt defined. That'll solve your problem.

View solution in original post

3 REPLIES 3
tomrvincent
Rhodochrosite | Level 12
Can you explain what you mean by 'automatically associate'? Does that mean a new program would have access to it? Or something else?
Phuels
Fluorite | Level 6

I'd like to create a macro (or series of macros) that:

  • Create a new program with the default connection string
  • Create the User_PASSWORD prompt
  • Associate the User_PASSWORD prompt with the new program without having to go into the program properties > prompts > add... to manually associate.
tomrvincent
Rhodochrosite | Level 12
What I do is have a egp template that has an autoexec program with the password prompt defined. That'll solve your problem.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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