Desktop productivity for business analysts and programmers

Moving by code file from Server to Local

Accepted Solution Solved
Reply
Contributor
Posts: 34
Accepted Solution

Moving by code file from Server to Local

Hi everybody,

 

my task is about moving some file from server with SAS Plaftform to my local machine, using SAS Enterprised Guide (Server and Local Machine under Windows Environment), but  i don't want to use the upload/dowload task or with the custom task proposed by Chris Eminger at this link but using a custom task by code.

 

I'm not so pro in technology but i think i can use the PIPE Command and send some command to system and moving file by File Transfert Protocol? can be a good and feasible idea? what type of information i need to do this, like permission, password, test network between server and local machine(how i can do this?) or other? how to do in Windows Environment, because in past i used in UNIX Environment and SAS Base the PIPE and "SCP OS command" from SERVER to SERVER and not in my local machine?

 

Some one can help me or suggest?

 

thank you very much

have nice day

MC

Martino Crippa

Accepted Solutions
Solution
‎11-23-2016 08:26 AM
Contributor
Posts: 34

Re: Moving by code file from Server to Local

The reason is that i have not the permission on my local pc to copy the *.dll file of custom task and for policy i can't install any software or other file in system folders...

 

So try something like that:

 

TO START I NEED:

1. enable the XCOMMAND

2. SAS SERVER can ping my local machine

3. SAS User from SAS server can copy to my local machine


TO DO LIST:
1. Understand my local ip with "ipconfig" from CMD on my machine (IPv4 Address)
2. TEST from SAS EG if SERVER can PING my local machine, for example:

filename CMD pipe 'ping XXXXXXXX';
data _null_;
    length rc $ 256 ;
    infile CMD length=reclen missover;
    input  rc $varying256. reclen;
    put rc=;
run;


3. COPY file from SERVER to MYLOCALMACHINE, for example:

filename CMD pipe 'copy C:\tmp\class.sas7bdat \\MYLOCALIP\C:\tmp\\class.sas7bdat';

data _null_;
    length rc $ 256 ;
    infile CMD length=reclen missover;
    input  rc $varying256. reclen;
    put rc=;
run;

any suggest or error?

 

is correct if i ask to IT Office to enable XCOMMAND to Workspace Server?

 

thanks

MC

Martino Crippa

View solution in original post


All Replies
Esteemed Advisor
Posts: 6,634

Re: Moving by code file from Server to Local

In most cases, working with EG means that SAS runs on a remote server. Using any external utility from SAS code will therefore necessitate that some kind of transfer server process runs on your PC, as the SAS code on the server will be using the client for the respective protocol.

Setting up a FTP or SSH server daemon on your desktop PC may prove to be less than trivial. One of the great handicaps of Windows is its lack of simple utilities (like the server daemons) that are in abundance in the UNIX world.

 

What is your reason for not using Chris Hemedinger's custom file transfer task?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎11-23-2016 08:26 AM
Contributor
Posts: 34

Re: Moving by code file from Server to Local

The reason is that i have not the permission on my local pc to copy the *.dll file of custom task and for policy i can't install any software or other file in system folders...

 

So try something like that:

 

TO START I NEED:

1. enable the XCOMMAND

2. SAS SERVER can ping my local machine

3. SAS User from SAS server can copy to my local machine


TO DO LIST:
1. Understand my local ip with "ipconfig" from CMD on my machine (IPv4 Address)
2. TEST from SAS EG if SERVER can PING my local machine, for example:

filename CMD pipe 'ping XXXXXXXX';
data _null_;
    length rc $ 256 ;
    infile CMD length=reclen missover;
    input  rc $varying256. reclen;
    put rc=;
run;


3. COPY file from SERVER to MYLOCALMACHINE, for example:

filename CMD pipe 'copy C:\tmp\class.sas7bdat \\MYLOCALIP\C:\tmp\\class.sas7bdat';

data _null_;
    length rc $ 256 ;
    infile CMD length=reclen missover;
    input  rc $varying256. reclen;
    put rc=;
run;

any suggest or error?

 

is correct if i ask to IT Office to enable XCOMMAND to Workspace Server?

 

thanks

MC

Martino Crippa
Contributor
Posts: 34

Re: Moving by code file from Server to Local

Hi Kurt, i forget to answer. My customer business users didn't have the permission by IT Department to use Chris Hemedinger's custom file transfer task.
Usually they copy in a manually way file from the remote folder that are mapped on their local pc.
thank you very much
Martino Crippa
Esteemed Advisor
Posts: 5,194

Re: Moving by code file from Server to Local

Enabling XCOMMAND is must if you are going to use PIPE or similar method.
But the whole setup seems awkward.
Can't you get access to the file on the server instead, or have the SAS session write the file to a file share?
What is "some file"?
Data never sleeps
Contributor
Posts: 34

Re: Moving by code file from Server to Local

i hope that Customer IT Department enabled the XCOMMAND.

 

"some file" are fromt *.sas7bdat, xlsx, csv, html or csv.

 

now the users bring in manually way the file from remote desktop by explorer, they had the remote disk mapped in their local machines.

 

tnks

 

M

Martino Crippa
Community Manager
Posts: 2,691

Re: Moving by code file from Server to Local

Good news! That custom task isn't "custom" anymore -- in EG 7.13 it's built into the application.

Contributor
Posts: 34

Re: Moving by code file from Server to Local

thank you very much
Martino Crippa
☑ This topic is SOLVED.

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

Discussion stats
  • 7 replies
  • 663 views
  • 1 like
  • 4 in conversation