BookmarkSubscribeRSS Feed
hhhhh
Calcite | Level 5

Hi All, 

 

when I am executing below code in sas 9.4 its working fine, but when same code I am trying to execute in sas EG, its just keep on running. Can anyone suggest me what is going wrong here?

 

Many thanks in advance...

 

data _null_ ;
* VERIFY PSFTP Success and report out;

rc=system("&LabDM_path\PuTTY\psftp &YYY@&ZZZ -b &LabDM_path\&DT_partl_path\&BAT..scr") ;

put rc;
if rc = 0 then Posting = datetime() ;
else Posting = .F; *<<---means file failed;
put Posting= datetime20. ;
run ;

9 REPLIES 9
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I would check that your system admin allows you to use operating commands from SAS first.  If so, then we would need to see what is exactly being done.  Open a command prompt and paste the actual command in there and run it.  Could hundreds of different things from access, to connection, to network drives, different operating system, etc.  I mean, just to start with your code, what does:

rc=system("&LabDM_path\PuTTY\psftp &YYY@&ZZZ -b &LabDM_path\&DT_partl_path\&BAT..scr") ;

Do, what does it resolve too?  We cannot guess these things.

hhhhh
Calcite | Level 5

Dear,

 

Many thanks for quick response. Below is the the explaination of given code-

 

rc=system("\\quintiles.net\Enterprise\Organization\GDM\LabDM\General\PuTTY\psftp &YYY@&ZZZ -b \\quintiles.net\Enterprise\Organization\GDM\LabDM\General\Hemant\sftp\Export\BAT.scr")

 

Also does this restriction from Windows or SAS EG?

 

Please let me know if you need more input from me.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

The restriction is set in EG as part of the options.  If that is enabled then set your command as a pipe and feedback the response from it:

filename tmp pipe "...";

data test;
  length buff $200;
  infile tmp;
  input buff $;
run;

In this way test will hold all the feedback from the operating system on what is happening.  It can be a lot of different things.

SuryaKiran
Meteorite | Level 14

Hi,

 

1)  How is the connection in SAS EG, is it connected to server or local? 

2) You have macros referenced, are they available in EG?

 

 

Thanks,
Suryakiran
hhhhh
Calcite | Level 5
Hi Suryakiran,
1) it is connected to server.
2) yes, they are available in EG.

Kind Regards,
Hemant
Kurt_Bremser
Super User

@hhhhh wrote:
Hi Suryakiran,
1) it is connected to server.
2) yes, they are available in EG.

Kind Regards,
Hemant

Which most probably means that your SAS 9.4 runs locally on your desktop, while EG uses a remote server. DO NOT assume that the environment of the server is the same as that on your desktop.

First verify that the system command you want to run works directly from the commandline, best from a remote login to the server.

Once that is done and it works, run the system command from SAS with the filename pipe method to catch all system responses (don't forget to add 2>&1 at the end of the command to reroute stderr output to the pipe).

hhhhh
Calcite | Level 5

Dear Kurt,

 

Yes, I am able to execute same command from cmd ,its working fine. How can I make it run using my program in EG?

 

Many thanks in advance.

-Hemant

r_behata
Barite | Level 11

Ensure that the X Commands options (which enable execution of the OS commands)  is enabled in your environment. 

 

Perhaps this link could help you.

 

http://support.sas.com/kb/41/058.html

 

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 1639 views
  • 2 likes
  • 5 in conversation