SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gloveman71
Calcite | Level 5

Just starting to use the SAS Enterprise Guide to process mainframe SMF data. When I try to run a program that has the Filename xxxxx FTP statement,it should prompt for my password, but no prompt is displayed.  I also tried to use the pass= statement but that also seems not to work.

When I use the traditional SAS 9.4 PC software, the prompt is displayed and the FTP functions fine.  Trying to find out how to get this working with EG,  The full statement is listed below for reference:

Filename work ftp "'xxxx.xxxx.xxxxx.xxxxx'" user=xxxxxx prompt rcmd='ascii' host='xxxxxx';

Anybody have this working and could step me through the process???

Thanx,

Jim Glover

Medical Mutual of Ohio

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Jim,

 

Let's suppose you named your prompt _PASSWORD_PROMPT.  Your code would look like this:

 

filename test ftp
'myfile.dat'
host='ftp.sas.com'
user='anonymous'
pass="&_PASSWORD_PROMPT"
rcmd='cd dropzone'
;

 

You need to wrap that macro variable reference in double-quotes (not single quotes) so that the macro processor can resolve it.

 

You can use encoding in your prompt definition so that the password is never clearly visible.  Select "masked single line" and then an encoding.  SAS can interpret the encoded value before passing to the FTP site.

pw_encoding.png

 

Then, from @koitaki on how to associate this prompt with your program:

 

For the benefit of others who may have a similar issue, you have to

(i) save the program,

(ii) then right click on the program (in the Project Tree) and select Properties.

(iii) choose Prompts

(iv) click on the "Add..." button then select the Prompt, and then click "OK"

 

Chris

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

View solution in original post

5 REPLIES 5
ChrisHemedinger
Community Manager

Hi Jim,

SAS Enterprise Guide cannot display the prompt that would be triggered in the FILENAME statement (or a LIBNAME statement).  That prompt would normally be displayed by the SAS windowing environment, and with SAS Enterprise Guide communicating with SAS remotely -- there is no facility to pop up a window.

However, you can create a prompt in your SAS Enterprise Guide project, and associate with the program that needs the password.  Select View->Prompt Manager, then click Add to define the prompt.  You can make it a password-style prompt, so the characters aren't echoed back into the log.  The Prompt Manager will create a macro variable for you, which you can then place into the PASSWORD field of your FILENAME FTP statement.

After you create the prompt, right-click on the Program node and select Properties.  In the Prompts tab, add a reference to the prompt you've just created.  When you run the program, the prompt displays.

Chris

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
Gloveman71
Calcite | Level 5

Chris,

Thanx for the great information,  I have setup the prompt, but am getting some errors which I have listed below:

ERROR 23-2: Invalid option name 'FTP PW Prompt_PASSWORD'n.

ERROR: Error in the FILENAME statement.

ERROR: Macro variable name 'FTP PW PROMPT_PASSWORD'N must start with a letter or underscore.

Can you provide me with a sample of how the variable is coded in the pass= statement??

Thanx again for all your help,

Jim Glover

ChrisHemedinger
Community Manager

Jim,

 

Let's suppose you named your prompt _PASSWORD_PROMPT.  Your code would look like this:

 

filename test ftp
'myfile.dat'
host='ftp.sas.com'
user='anonymous'
pass="&_PASSWORD_PROMPT"
rcmd='cd dropzone'
;

 

You need to wrap that macro variable reference in double-quotes (not single quotes) so that the macro processor can resolve it.

 

You can use encoding in your prompt definition so that the password is never clearly visible.  Select "masked single line" and then an encoding.  SAS can interpret the encoded value before passing to the FTP site.

pw_encoding.png

 

Then, from @koitaki on how to associate this prompt with your program:

 

For the benefit of others who may have a similar issue, you have to

(i) save the program,

(ii) then right click on the program (in the Project Tree) and select Properties.

(iii) choose Prompts

(iv) click on the "Add..." button then select the Prompt, and then click "OK"

 

Chris

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
koitaki
Fluorite | Level 6

So why wouldn't this work?

 

As in, no prompt appear, and then the log shows:

ERROR 180-322: Statement is not valid or it is used out of proper order.

WARNING: Apparent symbolic reference _PASSWORD_PROMPT not resolved.

 

Is there a default option that turns prompts off, or something like that?

 

My test code is simply:

password="&_PASSWORD_PROMPT";

 

 

(the Prompt name is correct, and the prompt entries appear correct as per your diagram - I was unable to paste a diagram in this message)

koitaki
Fluorite | Level 6

Ok no worries, I found it.

 

For the benefit of others who may have a similar issue, you have to

(i) save the program,

(ii) then right click on the program (in the Project Tree) and select Properties.

(iii) choose Prompts

(iv) click on the "Add..." button then select the Prompt, and then click "OK"

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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