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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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