BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
roohaa
Fluorite | Level 6

I want to read an excel file from local machine while my EG is connected to a server box and I cannot use local address like c:\...

I use task/data/copy files menu and copied the file to the server and then read it from there using a proc import. I need to call this step within my ptogram files to make sure that the latest version of the file is uploaded and read. Is there anyway that I call that step (Copy File) in a sas program within EG?

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

You can't run a server-based process (using SAS or something else) to do your file copy because of the security barrier. Talk to your SAS/IT administrator about setting up a folder location accessible by your SAS server where you can copy the file first before running your code. Preferably this folder location (share) should be accessible from both Linux and Windows. 

View solution in original post

6 REPLIES 6
SuryaKiran
Meteorite | Level 14

I don't think this is possible. What operating system is your server and your local machine.

 

One solution that comes into my mind is synchronizing the files using FTP Scripts. WinSCP is one such tool for transferring files. Check this

Thanks,
Suryakiran
roohaa
Fluorite | Level 6
Right, for sharing and simplicity purposes, I was trying to import data through SAS utilities. Now, I am using the data/import data to read the data but it cannot be scripted as there is one step of uploading the file to a temporary space and I am not sure how to script that.
ChrisHemedinger
Community Manager

No, you can't script the Copy Files task in a SAS program.  In SAS, you can use FILENAME FTP (alluded to by @SuryaKiran) or you can reference the file (if possible) from a shared network location.

 

The Copy Files task does not use SAS code for its work -- it copies the files in an FTP-like manner, but using the SAS session connection in place of the traditional FTP server.  Since the action is initiated by EG, you can't cue this up in a SAS program.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
roohaa
Fluorite | Level 6
I am using the SAS EG on linux box and the data or on windows. There is a security barrier that does not let me use proc import. However, I can use import/Copy Files in EG interface to read the data.
I need to replicate that process--copying the file from local to a temporary folder and then importing from there.
SASKiwi
PROC Star

You can't run a server-based process (using SAS or something else) to do your file copy because of the security barrier. Talk to your SAS/IT administrator about setting up a folder location accessible by your SAS server where you can copy the file first before running your code. Preferably this folder location (share) should be accessible from both Linux and Windows. 

Cotydog981
Calcite | Level 5

An alternative is to call your Programs in order by using an ordered list which will accept the copy functionality as a step. 

This way we ensure that the most recent file gets copied. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 6371 views
  • 5 likes
  • 5 in conversation