Desktop productivity for business analysts and programmers

Enterprise Guide issue with password prompt on Filename FTP

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Enterprise Guide issue with password prompt on Filename FTP

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


Accepted Solutions
Solution
‎07-20-2016 02:25 PM
Community Manager
Posts: 2,693

Re: Enterprise Guide issue with password prompt on Filename FTP

[ Edited ]

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

View solution in original post


All Replies
Community Manager
Posts: 2,693

Re: Enterprise Guide issue with password prompt on Filename FTP

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

Occasional Contributor
Posts: 12

Re: Enterprise Guide issue with password prompt on Filename FTP

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

Solution
‎07-20-2016 02:25 PM
Community Manager
Posts: 2,693

Re: Enterprise Guide issue with password prompt on Filename FTP

[ Edited ]

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

Occasional Contributor
Posts: 5

Re: Enterprise Guide issue with password prompt on Filename FTP

[ Edited ]

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)

Occasional Contributor
Posts: 5

Re: Enterprise Guide issue with password prompt on Filename FTP

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"

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 828 views
  • 2 likes
  • 3 in conversation