Avatar of aruku
aruku
 asked on

transfer from Compressed file - SAS dataset

Hi all,

I have a compressed file in a specific location in a different server. I need to transfer it onto a different server and create a sas dataset from that.

Can any one please help me on that.

Extension: .gz

Appreciate your help!!


Databases

Avatar of undefined
Last Comment
aruku

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
d507201

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
aruku

ASKER
Hi d507201,

Thanks for the response. I am trying to do the ftp and am getting the below error. Can you please help me on this


 filename source ftp 'export/home/xxxxx'
5          host=XXXXXXXXXX.abc.XXX.com'
6          binary dir
7          user=aak pass=XXXXXXXXX;
8          
9          filename target ftp '/sas/edaspace/XXXXXXX'
10         host='XXXXXXX.abc1.XXXX.com'
11         binary dir
12         user=aak pass=XXXXXXXXX;
13        
14         data _null_;
15         infile source('exl_final_prep_report.dat.gz') truncover;
16         input;
17         file target('exl_final.dat.gz');
18         put _infile_;
19         run;

ERROR: Open failed for file SOURCE  
ERROR: Connection refused.
ERROR: Open failed for file TARGET  
ERROR: Connection refused.
d507201

Connection refused means exactly that... you cannot connect to the server.  Something is wrong with either your host=, user=, or pass=.   You have an account on both servers, right, and can open a telnet session on each?  You That's the quickest way to test the server address, user id, and password.

In your fileref source, without a leading / it will look in your home directory for the path.  I don't think that that's the problem but it's something to check.

Are you running this from the source server?  If you're running from a desktop and have connected to the source or target then be sure you are RSUBMITing the code.
aruku

ASKER
I did connect to both the servers using telnet and am able to connect to them.

I am running this from the target server but am not rsubmiting the code

Do you think this is the issue?

Please let me know and appreciate your help
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
d507201

You should submit this the same way you do other SAS code to execute on the target server.

Only if you're editing the code in the SAS/Windows desktop editor and submitting it to run on a server do you need to encapsulate it in rusbmit...endrsubmit.  
theartfuldazzler

Hi Aruku

Add the DEBUG option to your filename statement, that way you should be able to see what the problem is:

 filename source ftp 'export/home/xxxxx'
          host=XXXXXXXXXX.abc.XXX.com'
          binary dir
          user=aak pass=XXXXXXXXX DEBUG;

filename target ftp '/sas/edaspace/XXXXXXX'
         host='XXXXXXX.abc1.XXXX.com'
         binary dir
         user=aak pass=XXXXXXXXX DEBUG;

If that does not help - post the log (hiding sensative passwords etc), so we can help.
aruku

ASKER
Here is the update on the issue:

What am I trying to do:

Using SCP need to transfer the file from source dir to target dir by triggering through target dir.

 
I have created rsa keys in the source server and shared it with target so don't need any password authetication.

I have tried logging into source server and using the below command in UNIX am able to transfer the file to target server:

scp {file to copy} {destination UID}@XXXXXXXXX: {destination location}

Now, I need to connect to the Source server through a SAS program running in target server and execute the aboe command using X command.

Can any one please help me on this.

Appreciate your help!!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
theartfuldazzler

Hi Aruku

I am not sure that your proposed solution ID: 36374107 will work:

1.  I am unsure if you have SAS loaded on the Source server.  If you do, can you rsubmit code to that server?

2.  If you can rsubmit, I am unsure that you will be able to execute an X command, as this is normally turned off by default on the remote server (NOXCMD)

Workin thru the comments above, I think you might need to use Secure FTP. And because you are moving a non-text file over, you will need to stream the file across.  Assuming your local / target server is Windows based:

 
filename source sftp 'export/home/xxxxx'
          host=XXXXXXXXXX.abc.XXX.com'
          binary dir
          RECFM=S LRECL=1 DEBUG;

%let work = %SYSFUNC(PATHNAME(Work));
%put &work;

filename target "&work" RECFM=N;

data _null_;
   infile source('exl_final_prep_report.dat.gz');
    input;
    file target('exl_final.dat.gz');
    put _infile_;
run;

Open in new window


The outstanding problem is that we don't know why you cannot connect.  Perhaps set the DEBUG option and post the log.

aruku

ASKER
Alternate Solution:

I have created RSA keys between both the servers so that there is no password authentication and then executed the below commands using X commands for SCP:

X "rm -f (destination location of the file);
    scp uid:(source server):/(Source location of the file) uid@(destination server):(destination location);
    gunzip (destination location)";

aruku

ASKER
I've requested that this question be closed as follows:

Accepted answer: 500 points for theartfuldazzler's comment http:/Q_27251517.html#36374747
Assisted answer: 0 points for aruku's comment http:/Q_27251517.html#36384869

for the following reason:

We can use the top one as alternate solution as well
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
SOLUTION
d507201

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
aruku

ASKER
Sorry for the confusion. The result first came from d507201. So that will be the primary solution
aruku

ASKER
alternate solution